File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Adding parameters to ActionForward Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Adding parameters to ActionForward" Watch "Adding parameters to ActionForward" New topic
Author

Adding parameters to ActionForward

AnilPrakash Raju
Ranch Hand

Joined: Jul 26, 2004
Posts: 137
Hi,

How can you add parameters to the path of actionForward?

eg. i want the jsp to go to taskAction.do?taskid=1 (where the taskId can change)

in the path, i got: taskAction.do
i need to add "?taskid=1" to the path.
I tried actionforward.setPath("path")
but a get an error "Configuration is Frozen" Message

Any suggestions?

thanks

Anil
Sheldon Fernandes
Ranch Hand

Joined: Aug 18, 2004
Posts: 157
You could try creating a new ActionForward using the existing ActionForward whose configuration is frozen, a clone so to say.

ActionForward modifiableActionForward = new ActionForward(existingActionForward);

Now you can modify the modifiableActionForward's path and return it from the method.

I have not tried this, but it should work. Not sure whether it is the right thing to do or if there is a better solution.

Please let us know, if this works or if you find something else that does.
Sheldon Fernandes
Tad Dicks
Ranch Hand

Joined: Nov 16, 2004
Posts: 264
How would you do this inside a page? to make a series of links that are similiar each with a different parameter or querystring?

-Tad
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding parameters to ActionForward
 
Similar Threads
passing dynamic parameter in redirect
Regarding apply JOIN by using JPQL.
instantiate ActionForward objects
POST parameter coming in null
Different pages pointing to the Same Struts Action