aspose file tools*
The moose likes Struts and the fly likes putting a value in request scope in struts2 from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "putting a value in request scope in struts2 from jsp" Watch "putting a value in request scope in struts2 from jsp" New topic
Author

putting a value in request scope in struts2 from jsp

sandy sean
Ranch Hand

Joined: Dec 30, 2010
Posts: 69
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

Joined: Mar 08, 2011
Posts: 188

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: putting a value in request scope in struts2 from jsp
 
Similar Threads
Struts forward problem
Struts2 wizard with scoped model driven
does a new action context created for every new action in struts2
forwarding request to an action from a jsp page
Passing an object between actions.