Bug 37699

Summary: c:if test fail when session invalidated using el
Product: Taglibs Reporter: Sebastiao <nex_sandro>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED DUPLICATE    
Severity: trivial    
Priority: P2    
Version: 1.1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   

Description Sebastiao 2005-11-29 19:59:13 UTC
My jstl build is 1.1.1.

When I try to make a test with "<c:if" using an variable defined in scriptlet, 
the test fail with the stacktrace:

java.lang.IllegalStateException: getAttribute: Session already invalidated
	org.apache.catalina.session.StandardSession.getAttribute
(StandardSession.java:975)
	org.apache.catalina.session.StandardSessionFacade.getAttribute
(StandardSessionFacade.java:113)
	org.apache.jasper.runtime.PageContextImpl.doFindAttribute
(PageContextImpl.java:469)
	org.apache.jasper.runtime.PageContextImpl.findAttribute
(PageContextImpl.java:454)
	org.apache.commons.el.VariableResolverImpl.resolveVariable
(VariableResolverImpl.java:157)
	org.apache.jasper.runtime.PageContextImpl.resolveVariable
(PageContextImpl.java:833)
	org.apache.commons.el.NamedValue.evaluate(NamedValue.java:124)
	org.apache.commons.el.UnaryOperatorExpression.evaluate
(UnaryOperatorExpression.java:156)
	org.apache.commons.el.ExpressionEvaluatorImpl.evaluate
(ExpressionEvaluatorImpl.java:263)
	org.apache.commons.el.ExpressionEvaluatorImpl.evaluate
(ExpressionEvaluatorImpl.java:190)
	org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate
(PageContextImpl.java:899)
	org.apache.jsp.jsp.index_jsp._jspx_meth_c_if_0(index_jsp.java:316)
...

I'm using session and variable this way:

<% 
	if(!session.isNew()) session.invalidate(); 
	String msg = (String) request.getAttribute("msg");
%>

I'm testing using variable msg this way:
...
                  <c:if test="${!empty msg}">
                  <tr>
                    <td valign="top" align="center" colspan="3"><font 
color="red">${msg}</font></td>
                  </tr>
                  </c:if>
...


I feel that "<c:if" try to find "msg" in session, when there's no session 
valid.

Thanks
Comment 1 Pierre Delisle 2005-12-16 02:00:01 UTC
This is a JSP container problem (not JSTL).
See bug 37929.



*** This bug has been marked as a duplicate of 37929 ***