How can I access a session variable in JSP that has been set in a servlet

0 views
Skip to first unread message

Raul

unread,
Aug 6, 2009, 7:36:25 AM8/6/09
to Java Web Application
Hello all

I am trying to access a session variable in a JSP page that has been
set in a servlet.

For example, when a USER logs into the application the LoginServlet
will set the User attributes in a User Bean and save that Bean in
Session so that the Logged User information can be found at any time
from the session.

Now I am searching for a way to display the Logged Users name in a JSP
page. Since the Logged User information is set in a User Bean and has
been saved in HttpSession, I have to access the HttpSesion in my JSP
page.

Now the matter is, I dont want to use any expression language like
<%= request.getsession() %> and am searching for a way that will be
something like
<jsp:getAttribute value=${pageContext.session.getAttribute()} />

(something that resembles XML format)

But I am not in a solution yet.

Also is there any way to use Standard JSTL library to access the
HttpSession of request?

Hope I am clear at my point and waiting for a solution from you
masters.


Regards
Raul

Reply all
Reply to author
Forward
0 new messages