This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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