Help coderanch get a
new server
by contributing to the fundraiser
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

putting a value in request scope in struts2 from jsp

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic