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

Getting Values in JSPs

 
Kunal Prakash Gandhi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having a jsp called in a frame, which in turn loads a child jsp on a button click.
On this child, i am getting some data from the user. This jsp has a 'back' button that takes him back to the parent. I want to store data on the child as well as the parent and call another jsp.
Where should i store all this data?
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Store the values in session -- this way they will be accessible across all pages of your application.

to store an object in session, call:
session.setAttribute(String name, Object Value);
To retrieve an object from session, call:
Object blah = session.getAttribute(String name);
Hope the Helps!
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"kunal"
Your name doesn't follow the javaranch guidelines. Please take a moment and change your "Publicly Displayed Name" by modifying your profile, after reviewing the guidelines at http://www.javaranch.com/name.jsp
Thanks for your cooperation.
- madhav
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic