• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
 
Their achilles heel is the noogie! Give them noogies tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic