aspose file tools*
The moose likes Struts and the fly likes howto make html:link dynamic select item of map ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "howto make html:link dynamic select item of map ?" Watch "howto make html:link dynamic select item of map ?" New topic
Author

howto make html:link dynamic select item of map ?

Nakata kokuyo
Ranch Hand

Joined: Apr 13, 2005
Posts: 437
hi good day,

i have a hashmap which hold the information for menu name, and it look like following :


which may result as follow :
map.put("menu1","menu1");
map.put("menu2","menu2");


then i have a jstl foreach loop for create link as following


this created link is fine if i have hard code it with
request.setAttribute("menu1", "menu1");
request.setAttribute("menu2", "menu2");

and the result will show mke the link pass a parameter to other page which is something like this "menu1.do?menuname=menu1",

but my problem is , i try to avoid hardcode it into request, and prefer to make it dynamically when i have a menu name with "menu1", it will go Hashmap find the key for "menu1" and insert into "paramName" property

can someone guide me how to do so ? thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: howto make html:link dynamic select item of map ?
 
Similar Threads
how to set a ArrayLIst property of form from jsp
how to iterate list in a table using jstl
How to Set HashMap in request attribute using JSTL Tag
Hashtable and iterate
Generating Horizontal Menu in JSF using h:dataTable