Note that the codes in this blog post have not been tested. I will update this post once I have tried implementing them.
Session Variables
Session variables are useful for associating data with your visitor. The variables will disappear once the session expires. Here is what you need:
1) A HTML Form to retrieve data from the visitor
<FORM METHOD=POST ACTION="savedata.jsp"> |
2) savedata.jsp – This is the target page of the form, and this page manipulates the data.
<% <HTML> |
First, you retrieve the value of the parameter "username" that was posted using the form; then you set the attribute "theName" with the value that was retrieved. To retrieve the session value, use the getAttribute(..) function and pass in the attribute name.
Source: http://www.jsptut.com/Sessions.jsp.
No comments:
Post a Comment