View | Details | Raw Unified | Return to bug 56334
Collapse All | Expand All

(-)java/org/apache/jasper/compiler/ELParser.java (-3 / +3 lines)
Lines 255-261 Link Here
255
     *
255
     *
256
     * @return The escaped version of the input
256
     * @return The escaped version of the input
257
     */
257
     */
258
    private static String escapeLiteralExpression(String input,
258
    static String escapeLiteralExpression(String input,
259
            boolean isDeferredSyntaxAllowedAsLiteral) {
259
            boolean isDeferredSyntaxAllowedAsLiteral) {
260
        int len = input.length();
260
        int len = input.length();
261
        int lastAppend = 0;
261
        int lastAppend = 0;
Lines 552-560 Link Here
552
    }
552
    }
553
553
554
554
555
    protected static class TextBuilder extends ELNode.Visitor {
555
    static class TextBuilder extends ELNode.Visitor {
556
556
557
        private final boolean isDeferredSyntaxAllowedAsLiteral;
557
        protected final boolean isDeferredSyntaxAllowedAsLiteral;
558
        protected StringBuilder output = new StringBuilder();
558
        protected StringBuilder output = new StringBuilder();
559
559
560
        protected TextBuilder(boolean isDeferredSyntaxAllowedAsLiteral) {
560
        protected TextBuilder(boolean isDeferredSyntaxAllowedAsLiteral) {
(-)java/org/apache/jasper/compiler/Validator.java (-1 / +3 lines)
Lines 1448-1454 Link Here
1448
1448
1449
            @Override
1449
            @Override
1450
            public void visit(Text n) throws JasperException {
1450
            public void visit(Text n) throws JasperException {
1451
                output.append(xmlEscape(n.getText()));
1451
                output.append(ELParser.escapeLiteralExpression(
1452
                        xmlEscape(n.getText()),
1453
                        isDeferredSyntaxAllowedAsLiteral));
1452
            }
1454
            }
1453
        }
1455
        }
1454
1456
(-)test/org/apache/jasper/compiler/TestParser.java (+3 lines)
Lines 412-417 Link Here
412
        Assert.assertTrue(result, result.contains("<set data-value=\"03b\\\\x\\?resize03b\"/>"));
412
        Assert.assertTrue(result, result.contains("<set data-value=\"03b\\\\x\\?resize03b\"/>"));
413
        Assert.assertTrue(result, result.contains("<04a\\?resize04a/>"));
413
        Assert.assertTrue(result, result.contains("<04a\\?resize04a/>"));
414
        Assert.assertTrue(result, result.contains("<04b\\\\x\\?resize04b/>"));
414
        Assert.assertTrue(result, result.contains("<04b\\\\x\\?resize04b/>"));
415
        Assert.assertTrue(result, result.contains("<set data-value=\"05a$${&amp;\"/>"));
416
        Assert.assertTrue(result, result.contains("<set data-value=\"05b$${&amp;2\"/>"));
417
        Assert.assertTrue(result, result.contains("<set data-value=\"05c##{&gt;hello&lt;\"/>"));
415
    }
418
    }
416
419
417
    /** Assertion for text printed by tags:echo */
420
    /** Assertion for text printed by tags:echo */
(-)test/webapp/bug5nnnn/bug56334.jspx (+5 lines)
Lines 29-32 Link Here
29
29
30
    <jsp:element name="04b\\x${'\\?resize04b'}"></jsp:element>
30
    <jsp:element name="04b\\x${'\\?resize04b'}"></jsp:element>
31
31
32
    <!-- Test 5: Use \$, \# in template text -->
33
    <set data-value="05a\$\${&amp;" />
34
    <set data-value="05b\$\${&amp;${1+1}" />
35
    <set data-value="05c\#\#{&gt;${'hello'}&lt;" />
36
32
</jsp:root>
37
</jsp:root>

Return to bug 56334