• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Newbie: Struts 1 -> Passing from one struts action to another

Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have two questions w.r.t struts. Following is an example of my action mapping:

<action path="/actions/firstAction"
<forward name="success"
<forward name="failure"

<action path="/actions/secondAction"
<forward name="success" page="/pages/businessPage.jsp"/>

1. How can i pass objects from one action class to another? Say from FirstAction to SecondAction
Can i use request.setattribute in the first action class to set the object and get in the second action using request.getattribute, which i can then set in the form of the seconAction?
If i define a third action class, will the object set in the first action also be accessible in the third action class (without me setting it again explicitly in the second action class)?
Are there any implications of using request.setattribute?

2. Is it better to set the object in some database on form submission in the first action class and then retrieve it in the second action class from the database, set it in the form bean for display in the jsp?
Brace yourself while corporate america tries to sell us its things. Some day they will chill and use tiny ads.
a bit of art, as a gift, the permaculture playing cards
    Bookmark Topic Watch Topic
  • New Topic