creating session in jsp

I want to create a jsp session in which i define a variable and call it in the other pages;please help
[116 byte] By [soumayaa] at [2007-11-27 5:42:20]
# 1

hi,

for creating session,

String uname = "admin";

session.setAttribute("username",uname);

for retreiving the value from session.

String uname = (String)session.getAttribute("username");

session is an implicit object in jsp, if u want to use in servlet Declare like this.

HttpSession session = request.getSession();

Bala

art84a at 2007-7-12 15:20:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...