Two Laptop Bag*
The moose likes Struts and the fly likes How to get parameter using struts Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to get parameter using struts Tag" Watch "How to get parameter using struts Tag" New topic
Author

How to get parameter using struts Tag

lyo Yashnoo
Ranch Hand

Joined: Sep 15, 2003
Posts: 50
Hi everyone:
There is a.jsp pass a parameter to b.jsp.How to get the parameter in b.jsp using struts Tag?I also want to add the parameter to a hyperlink in b.jsp.For example in b.jsp <html:link forward=.....>cxxxx</html:link>.How to add the parameter(get from a.jsp) to cXXXX in b.jsp? :roll:
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4456
    
    6

You could use bean:parameter & bean:write. Or you could use a JSP expression: <%= request.getParameter("theParam") %>
[ October 08, 2003: Message edited by: Junilu Lacar ]

Junilu - [How to Ask Questions] [How to Answer Questions]
lyo Yashnoo
Ranch Hand

Joined: Sep 15, 2003
Posts: 50
Hi
I think use the bean:write or bean arameter will be better.Because I don't want to see any java code in my jsp.
But the problem is that the Tag bean:write need a javabean for storing the "id" parameter.It means I must create a new javabean for only one property "id" and pass it to request.The id has its getter and setter method.
Have any good idea? :roll:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to get parameter using struts Tag