aspose file tools*
The moose likes Struts and the fly likes pass parameter inside action path in struts-config.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "pass parameter inside action path in struts-config.xml" Watch "pass parameter inside action path in struts-config.xml" New topic
Author

pass parameter inside action path in struts-config.xml

shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
I have a search screen where in if there is an exact match I have to show the detail page diretcly. If the search returns more than one record then I show a list of records. The user double clicks and then reaches the detailed page.

When there is a direct match inside my action class.


if search returns a list of records



Firstcase the url is http:.../'showGroupDetails.do
secondcase my url is like http:.../'showGroupDetails.do?groupid=1


I want same kind of url for both. how can this be achieved? Is there way I can change my struts-config to accept query parameter?
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
This should be very easy...just append the parameters to the end of the path after calling findForward. The problem is that a forward cannot be modified after it is created. Maybe there is an easier way to do this, but I created this utility method for doing this:


- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: pass parameter inside action path in struts-config.xml
 
Similar Threads
Query String Problem
Passing an Array to a Javascript function
populate dropdown with database values
using ajax and struts iterate tags
How to pass an arrayList from a JSP to a servlet.