Two Laptop Bag*
The moose likes Struts and the fly likes struts - how to solve problem of URL parameter? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts - how to solve problem of URL parameter?" Watch "struts - how to solve problem of URL parameter?" New topic
Author

struts - how to solve problem of URL parameter?

Alvin chew
Ranch Hand

Joined: Jan 08, 2004
Posts: 834
hi, good day , i have a question on struts ..i have an action , which after completed process will then forward to a page which contain multiple form in a page(tabbed form), in order to display correct form to user , i might need some URL parameters to help select the correct form, it will however look like '/WEB-INF/results/result1.jsp?showform=2' as mappingforward..i might also need to have several similar kind of mappingforward for '/WEB-INF/results/result1.jsp?showform=1' , showform=3 ...etc

can someone guide me how to write the forward? i using following way but is not working



or someone guide me the proper way to settle this problem ...thank you very much for your time
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30116
    
150

Alvin,
Struts forwards aren't really designed to pass data through parameters.

A better approach is to have your action store the value as an attribute in the request:
request.setAttribute("showForm", new Integer(2));

The JSP can then get this value and render the appropriate form.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Alvin chew
Ranch Hand

Joined: Jan 08, 2004
Posts: 834
thanks, Jeanne Boyarsky ...it really help ..thank you
 
Don't get me started about those stupid light bulbs.
 
subject: struts - how to solve problem of URL parameter?
 
Similar Threads
WSAD 5.1.2 caching jsps
Problem running a struts 1.1 tutorial
No getter method for property finame of bean org. apache. struts. taglib. html. BEAN
DispatchAction coding problem ~~mod pls check this thread, display problem,tq
struts1.1 and tomcat 5.5.27