Wednesday, November 3, 2010

How to set session variables from JSP

set session variables using the command given below
session.setAttribute( "theName", "sanjeewa malalgoda" );
//session.setAttribute( "Attribute name", "Value" );

Get session variables using the command given below
<%= session.getAttribute( "theName" ) %>
//this may return null if there no such session variable

No comments:

Post a Comment