Bug 61816 - Jsp Precompile doesn't fail on ${}
Summary: Jsp Precompile doesn't fail on ${}
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 8.5.13
Hardware: PC All
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-24 22:39 UTC by Fresh Codemonger
Modified: 2017-11-25 19:48 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fresh Codemonger 2017-11-24 22:39:31 UTC
Fails at runtime with:

Failed to parse the expression [${}] Encountered " "}" "} "" at line 1, column 3.
Was expecting one of:
"{" ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<STRING_LITERAL> ...
"true" ...
"false" ...
"null" ...
"(" ...
"[" ...
"!" ...
"not" ...
"empty" ...
"-" ...
...
...
"(" ...
Comment 1 Mark Thomas 2017-11-24 23:09:04 UTC
That is consistent with the current behaviour without pre-compilation. The error is triggered at runtime so I wouldn't expect it to be triggered by pre-compilation.

The question is should ${} trigger a translation error or not. That needs some spec research.
Comment 2 Mark Thomas 2017-11-25 19:30:21 UTC
<quote>
JSP.2.7
JSP containers are required to produce a translation error when a syntactically
invalid EL expression is encountered in an attribute value or within template text.
</quote>

And, since ${} is not valid there should be a translation error (i.e. a compile time error). The fix looks fairly simple.
Comment 3 Mark Thomas 2017-11-25 19:48:33 UTC
Fixed in:
- trunk for 9.0.2 onwards
- 8.5.x for 8.5.24 onwards
- 8.0.x for 8.0.48 onwards
- 7.0.x for 7.0.83 onwards