June 2005
Beginner to intermediate
336 pages
6h 29m
English
You need some way of storing data between page accesses, and one way of doing that is to use the session object, which comes built in to the JSP environment, ready for you to use. To use this object, you start with the JSP page directive at the top of the JSP page, setting this directive's session attribute to true to indicate that you want to use sessions:
<%@page import = "java.util.*" session="true"%>
This makes sure that opening this page starts a new session if such a session doesn't already exist.
NOTE
The page directive is not really necessary here, because the default for the session attribute is true, but it's included here just for completeness; you can omit it in your own code. More on this directive ...
Read now
Unlock full access