This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

putting a value in request scope in struts2 from jsp

 
sandy sean
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1)consider this scenario:-

Action1------1st req------->view.jsp------2nd req--------->action1 again

In struts2 for each new request a new action object gets created.
So when request comes back again to action1 then for 2nd request, will a new action1 object get

created or the same one (used in 1st req) get used?

2)consider this scenario:-

Action1------1st req------->view.jsp------2nd req--------->action2

i am putting some object in request scope in action1 which i am using in view.jsp. and i also

want to retrieve that same object in action2. How to do this??

Actually since the object is in request scope it gets lost during 2nd request.
So in strust2 how to put some object in request scope (or any scope) from within the jsp so that
i can pass it to another resource.
 
debraj mallick
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi sandy,

you can achieve this using action chaining : http://struts.apache.org/2.2.3.1/docs/action-chaining.html
OR
you can use param in your struts.xml

hope this would help you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic