Bug 56612 - Jasper is not able to parse two consecutive escaped single quotes in EL
Summary: Jasper is not able to parse two consecutive escaped single quotes in EL
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 8.0.5
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-10 13:02 UTC by Pavel Horal
Modified: 2014-07-29 09:16 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Horal 2014-06-10 13:02:42 UTC
JSP compiler breaks when it encounters two consecutive escaped single quotes in EL.

Example JSP:

    ${'\'\''}

Expected result:

    ''

Result:

    org.apache.jasper.JasperException: /test.jsp (line: 1, column: 3) Unterminated ${ tag
	org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
	org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:276)
	org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:92)
	org.apache.jasper.compiler.Parser.parseELExpression(Parser.java:760)
	org.apache.jasper.compiler.Parser.parseElements(Parser.java:1473)
	org.apache.jasper.compiler.Parser.parse(Parser.java:139)
	org.apache.jasper.compiler.ParserController.doParse(ParserController.java:229)
	org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
	org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:200)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:375)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:355)
	org.apache.jasper.compiler.Compiler.compile(Compiler.java:342)
	org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
	org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
	org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
	org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Bug is also present in Tomcat 7.0.53.
Comment 1 Mark Thomas 2014-06-10 22:47:07 UTC
Thanks for the report. This has been fixed in 8.0.x for 8.0.9 and in 7.0.x for 7.0.55 onwards.
Comment 2 Mark Thomas 2014-07-29 09:16:45 UTC
This has been fixed in 6.0.x and will be included in 6.0.42 onwards.