Mantis - Resin
Viewing Issue Advanced Details
348 minor always 08-12-05 00:00 11-30-05 14:42
ralscha  
 
urgent  
closed 3.0.14  
3.0.14 fixed  
none    
none 3.0.15  
0000348: c:if problem with var
RSN-392
I try to port a application from Tomcat to Resin. Now I have a problem
with the <c:if> tag. It behaves differently in Resin.


<c:if test="${not empty sessionScope.header_variables}" var="hh">
  test22
</c:if>

Tomcat:
Evaluates the condition, executes the body if its true and sets the
result into variable hh.

Resin:
Evaluates the condition and sets the result into the variable hh. But
it does not evaluate the body.

This ist the generated jsp page without var:
      if (_caucho_expr_2.evalBoolean(pageContext)) {
        out.write(_jsp_string14, 0, _jsp_string14.length);
      }
and this with var:
     pageContext.setAttribute("hh", (_caucho_expr_2.evalBoolean(pageContext)) ? Boolean.TRUE : Boolean.FALSE)


In my opinion this is a bug. The JSTL Specification is clear about
this point: "If the test condition evaluates to true, the body content is evaluated
container and the result is output to the current JspWriter.
var=Name of the exported scoped variable for the
resulting value of the test condition. The type of the scoped variable is Boolean."
Windows XP, J2SDK 5.0 Update 4, Resin 3.0.14 and Resin 3.0.s050811

Notes
(0000395)
ferg   
08-12-05 00:00   
jsp/1j17