File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes passing value from one action to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "passing value from one action to another" Watch "passing value from one action to another" New topic

passing value from one action to another

Marco Vanoli
Ranch Hand

Joined: Jan 12, 2005
Posts: 99
I am using dispatch action.
I have a delete method and a list method under the same action.
After deleting the entry i just call a forward to the other dispatched actione.
I need to pass a long value from one method to another. I tryed using request.setParameter("id",id) and relative get but seems every method look at the jsp parameter, not at that i have set.

Then i have to use class variale or to use a session scope, or something other??
Using this one i read this is not thread safe.. how can i do.

Thanks to all want help me

bye, <br />Marco
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33125

When passing values, you use get/setAttribute() rather than getParameter(). That way you can set values independent of a form.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: passing value from one action to another
jQuery in Action, 3rd edition