• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with save into memory

 
Harry Kyoshiro
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hay,..


I'm now build web application.
I'm confused with this case :

I have 2 form, 1st form contain 1 field name and 1
button next. i filled name with my name harry and i
click next. it will save INTO MEMORY, NOT DATABASE.
Now it continue to 2nd form. 2nd form will show
"welcome harry" & contain dropdown button contain list
of book & 2 button finish and add to basket. when i
select book from dropdown button and i click add to
basket, it will return the same form but below the
form appear the book i've selected etc. But remember
IT NOT SAVE INTO DATABASE. When i click finish NOW ITS
SAVE TO DATABASE.


My question is how we can save into memory ?
i used tomcat 4.1.29 as container and velocity as
presentation layer and jdk1.5.0

Thanks before
 
Neeraj Dheer
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you might want to look up sessions in servlets to achieve what you are trying to do.
 
vjy chin
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
you can use session as Neeraj pointed out.

e.g you can set the value , i.e ur name here using session.setAttribute("userName", "Harry") in the first page. In the second page you can use session.getAttribute("userName") and you can display that.
One other way is to use hidden parameters.

Hope it helps
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!