File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Adding parameters to ActionForward

AnilPrakash Raju
Ranch Hand

Joined: Jul 26, 2004
Posts: 137

How can you add parameters to the path of actionForward?

eg. i want the jsp to go to (where the taskId can change)

in the path, i got:
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?


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?

I agree. Here's the link:
subject: Adding parameters to ActionForward
It's not a secret anymore!