Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding the jsp data store

 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,
I want help from you.First let me explain the scenario.

I developed on jsp in that i created one form having the
two variables like EmpNO:----------- and EmpName:----------.

now once form displayed on the browser when jsp is running and i submit the emp name and no those are set and get by the javaben help.That is i wrote one javabean to store data.

now my query starts,
already i entered emp name and no.i can retrieve with the help of bean get method.now again i entered the another name and no for emp.

now my question is i want to display the both the names and no's entered by me.I dont want to use database right now.i want store form data in collection object and i want to retrieve all the data.

please give code lines also
if possible.

cheers,
babu.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okie. Please store the data in any collection you want, ArrayList prefered. Then place your collection in user's session object. You would definitely able to get all the data you entered previously from that session object. Remember, if session expires by any means, all will be lost.
 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can you give sample code.
 
Babar Qadri
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by babu amara:
can you give sample code.


If you are using Tomcat, you would surely find an example of session servlet in your TOMCAT_HOME/webapps/servlets-examples/WEB_INF/classes/SessionExample.java
 
A Babu
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cheers,
babu.
[ November 30, 2005: Message edited by: babu amara ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic