• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

howto make html:link dynamic select item of map ?

 
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic