PDA

View Full Version : Access to session from jsp / jstl



jboring
Sep 16th, 2004, 11:46 AM
I know this is stupid but this is how my day is going :?

I need access to session from JSTL. When I try the following:

<c:out value="${sessionScope.USER_SESSION_CONTEXT.tabMenuState}"/>

I get:

JasperException: can't access SESSION_SCOPE without an HttpSession

But when I put in <%@ page session="true" %>

I get:

JasperException: /WEB-INF/jsp/tabMenu.jsp(3,0) jsp.error.session.multiple


Jeff

olivier
Sep 17th, 2004, 02:37 AM
It would be my first guess, but I am retrieving variables from the session correctly using the <c:out value="${pageContext.session.tabMenuState}"/>

Here is a nice pointer on how to retrieve variable in JSTL depending on the scope.

http://www.informit.com/articles/article.asp?p=30946&seqNum=7