• 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

Keeping request information through other requests

 
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i inittialy posted a similar question on JSP forum. I wanted to know if there was a way to keep attributes from one JSP to another JSP, keeping in mind the the data to the first JSP came from an Action object.
Something like (inside Action)

Retrieving the data in the first JSP (the one wich Action forwarded to )

Then, someone ansewed me that the best technique i could use to send the same DTO do someOtherPage.jsp, was to use HttpSession (actually, at this point of the discussion, i didn't say that i was using struts).
I replied the message and said i was using struts, then, someone else replied me with foloowing about Struts.


Requests attributes and parameters survive request dispatching only.
Struts dispatches requests by default. So, you can access the attributes and parameters in the later jsp.
[/code]
So, could anyone make a explanation for me? How come my DTOs can be accessed in someOtherPage.jsp if the DTOs were property of the request?
I just need some more understanding. I example would also help...
Thanks a lot,
ltcmelo

 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand that quote.
If the Action sets a requestAttribute and forwards to a jsp, the object is accessible by that jsp because it is a part of that request. But after the jsp runs and the browser receives it the request is over. If there are no other active references to the object from that request you can kiss it goodbye. The next thing the user clicks on generates an entirely new request.
 
reply
    Bookmark Topic Watch Topic
  • New Topic