• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hidden Fields  RSS feed

 
kiran chaudhari
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How session is maintained using hidden fields?
 
Dhanesh Chaudhari
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For maintaining session through hidden field, you have to maintain one hidden field.
First create a unique id on server side then set it to header(by using setHeader() method). Then you have to retrieve that id through javascript on each jsp, maintain that Id with hidden filed , send that unique id to the server with hidden filed then match it on server side, if both ids are same then server knows that the request comes from the same user.Then server fulfill the request.
But its a traditional and complected ways. You can use more smarter way to maintain the session.
Hope, this will helpful to you.Thanks.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is he going to set a hidden field on the header?
You will need create the hidden field on your form, and use that to pass values back and forth. The values can be a unique id created by the servlet. You can search the forum, because I am sure it has been discussed a number of times.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!