• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

struts html:link

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone know of any example or how to use the struts <html:link> when passing accross multiple parameters?
help would be much appriciated!
 
Ranch Hand
Posts: 374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can put your parameters in a map with the parameter name as the key and the parameter value as the value. i.e. if you want to link to
myJsp.jsp?x=4&y=2:
1) create your map somewhere
<%
HashMap paramMap=new HashMap();
paramMap.put("x", "4");
paramMap.put("y", "2");
%>
2) create your link
<html:link page="myJsp.jsp" name="paramMap" />
I haven't done this exactly so the syntax may not be exactly right on the link name. However, you can always use both name and property to get a property of a bean that is declared as a Map. i.e. have a bean with a getter
public Map getLinkParams() { return linkParams; }
I've used this in the past, and it works great.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic