Mantis - Resin
Viewing Issue Advanced Details
1431 major always 10-30-06 16:30 10-01-06 13:53
closed 3.0.22  
none 3.0.22  
0001431: multiple bugs with EL expression output in JSP document template data
Using expressions like

${'C'}a b c d e


${'}'}A B C

in template text in JSP documents (.jspx file) results in miscompiled .java source files in the work directory which have an extra, garbage character being output at the end of the directive.

The second example, a right curly brace inside a string literal exhibits an additional bug: an escaped quote is output before the right curly brace. The spec says that ${'}'} should just output the right curly brace.

Finally, the results of the EL expressions in template text are XML-escaped, whereas the spec implies that they should be unescaped (and that <c:out> should be used to produce escaped text).

These bugs only affect EL expressions in template data (outside of actions) in JSP documents, not JSP pages.
Attached is a small JSP document exhibiting the bugs. The meat of the test is in the following lines:

         pageContext.setAttribute("testString", "-'-");
    Extra character at end: ${'string'}a b c d e<jsp:text>
    Extra character at end: ${'C'}1 2 3 4 5</jsp:text><jsp:text>
    Character escaped: ${testString}1 2 3 4 5</jsp:text><jsp:text>
    Extra characters before { and at end: ${'}'}A B C</jsp:text>

When run on my test system, it results in the following output:

    Extra character at end: stringa b c d ec
    Extra character at end: C1 2 3 4 5c
    Character escaped: -&0000039;-1 2 3 4 5
    Extra characters before { and at end: &0000039;}A B C&0000034;

10-01-06 13:53