Bug 48668 - Template text that looks like a deferred expression can be mishandled even if EL is ignored
Summary: Template text that looks like a deferred expression can be mishandled even if...
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 6
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 6.0.24
Hardware: All All
: P2 minor (vote)
Target Milestone: default
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-03 09:22 UTC by support
Modified: 2010-03-09 15:10 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description support 2010-02-03 09:22:59 UTC
In some cases text that happens to look similar to a deferred expression (#{..}) can get mangled even if the EL is not active. This appears to only happen if the text in question immediately proceeds a custom tag (either a full blown custom tag or a simple .tag file tag). The initial # and { characters get removed.

This happens in Tomcat v6.0.24 but did not happen in v6.0.20 so appears to be unintentional.

We have been upgrading legacy sites to Tomcat v6 and have hit this problem.

This problem can be recreated in a bog standard install of Tomcat v6.0.24. Create a simple .tag file that does nothing more than say 'hello'. Place a reference to this tag into a JSP with the offending text immediately after it. 

A test JSP that looks something like (note that EL is being ignored)...

<%@ page isELIgnored="true" %>
<%@ taglib tagdir="/WEB-INF/tags/custom" prefix="custom" %>
<html>
<title>Test</title>
</head>
<body>
  <custom:example />#{foo.bar}
</body>
</html>

Where the custom example tag (/WEB-INF/tags/custom/example.tag) looks like this...

Hello

Rather than the page returning the following...

<html>
<title>Test</title>
</head>
<body>
  Hello#{foo.bar}
</body>
</html>

It will return...

<html>
<title>Test</title>
</head>
<body>
  Hellofoo.bar}
</body>
</html>

Notice the missing # and { from the text.

I don't believe the platform Tomcat is running on matters. Have seen this behaviour on both Mac OS X and Linux.
Comment 1 Mark Thomas 2010-02-07 18:03:40 UTC
Thanks for the report. This has been fixed in trunk and proposed for 6.0.x
Comment 2 Mark Thomas 2010-02-23 23:00:13 UTC
This has been fixed in 6.0.x and will be included in 6.0.25 onwards.
Comment 3 Konstantin Kolinko 2010-03-06 20:51:09 UTC
Reopening.

Additional tests added in r919847.
Some of them are failing.

This issue is also reproducible in the current 5.5 using /test/webapp/bug48668a.jsp from trunk. (bug48668b.jsp is not applicable to 5.5)
Comment 4 Mark Thomas 2010-03-09 15:10:23 UTC
Additional fixes have been applied to trunk and 6.0.x and will be included in 6.0.26 onwards.