aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30764
    
156

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts - how to solve problem of URL parameter?