Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HttpSession and persistent variables 1

Status
Not open for further replies.

Gaelle

Programmer
Jun 20, 2001
62
FR
Hello !

I have a part of an intranet site I'm working on, in which I have variables that I have to access from many pages. For the moment,I pass these variables from page to page, but it's no good solution because there are many of them.
Is there a solution in JSP permitting to set variables and to access them from any page ?
Does the HttpSession helps for that ?
I can't find much information about it.

Thanks,
Gaelle.
 
you can use the following to create and read session variables

session.setAttribute("Username", Name);
and
(String)session.getAttribute("Username");
(Type casting is important)

Like session variables application variables are also available. These are used the same way in which session variables are but are application wide(They exist on all sessions).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top