• Post Reply Bookmark Topic Watch Topic
  • New Topic

Storing Intermediate Values  RSS feed

 
Naresh Shanmugam
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JSP "A" and on clicking a link in it, it should take to a new JSP "B". In "B" there will be "return back" link which takes me back to page "A". So what is the best way to store the values displayed in page "A". Right now we are using comma seperated String and we are putting that string in to the session and retrieving back to values. Is it the right way for doing it? should i use Map to store intermediate values?
 
Abhi Agar
Greenhorn
Posts: 26
Java MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seriously, I didn't get it. Can you please reframe the question. Can you show us the code.
What values do you want to display?
Is it like a shopping cart?
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
session is ok, Map is not necessary. Use a designated object (designed to fit the data in JSP A) if the intermediate elements (means the fields) are not dynamic. Say for example, if JSP A has always user name and email ID go for an simple object. If you do not know what are the elements in A then go for a map (however, comma separator is not a good idea since it is used as separator for many other system scenarios)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!