You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2018/10/09 02:59:55 UTC
[Bug 62808] New: "function-signature" text coutaining line breaks
causes JasperException
https://bz.apache.org/bugzilla/show_bug.cgi?id=62808
Bug ID: 62808
Summary: "function-signature" text coutaining line breaks
causes JasperException
Product: Tomcat 7
Version: 7.0.91
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: Jasper
Assignee: dev@tomcat.apache.org
Reporter: katsuta_k@worksap.co.jp
Target Milestone: ---
When a function was defined in tld file with function-signature containing line
breaks causes JasperException in Tomcat v7.0.91.
For example
```
<function>
<name>getSomething</name>
<function-class>com.example.Functions</function-class>
<function-signature>
com.example getSomething(com.example.longpackagename.Foo,
com.example.longpackagename.Bar,
com.example.longpackagename.Baz)
</function-signature>
</function>
```
This function definition works well in Tomcat v7.0.85 But not work in Tomcat
v7.0.91.
In Tomcat v7.0.91, this definition causes JasperException like bellow.
```
Oct 09, 2018 11:22:04 AM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: Invalid syntax for function signature in
TLD. Tag Library: xxx, Function: getSomething
at
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:56)
at
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:445)
at
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:165)
at
org.apache.jasper.compiler.Validator$ValidateVisitor.getMethod(Validator.java:1648)
at
org.apache.jasper.compiler.Validator$ValidateVisitor.processSignature(Validator.java:1635)
at
org.apache.jasper.compiler.Validator$ValidateVisitor.access$400(Validator.java:420)
at
org.apache.jasper.compiler.Validator$ValidateVisitor$1FVVisitor.visit(Validator.java:1611)
at org.apache.jasper.compiler.ELNode$Function.accept(ELNode.java:139)
...
```
However, according to the specification of JSR 245, "function-signature" can
contain line breaks (LF or CRLF).
So I think that this behavior violates the specification.
http://download.oracle.com/otn-pub/jcp/jsp-2.1-fr-spec-oth-JSpec/jsp-2_1-fr-spec.pdf
The detail of definition is below.
The spec of "function-signature" element was defined in p. 3-32 as follows.
```
function-signature element is as follows:
FunctionSignature ::= ReturnType S MethodName S?
’(’ S? Parameters? S? ’)’
ReturnType ::= Type
MethodName ::= Identifier
Parameters ::= Parameter
| ( Parameter S? ’,’ S? Parameters )
Parameter ::= Type
```
The "S" was defined as follows.
p. 1-27
```
S::= XML::
```
p. 1-16
```
The prefix XML:: is used to refer to an EBNF definition in the XML 1.0 speci-
fication. Refer to http://www.w3.org/TR/REC-xml
```
https://www.w3.org/TR/REC-xml/#NT-S
```
S (white space) consists of one or more space (#x20) characters, carriage
returns, line feeds, or tabs.
```
We think that this change is the cause of this problem and I'm afraid that
the same change was also done in Tomcat v8.0.x and v9.0.x
ref.
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/jasper/compiler/Validator.java?r1=1840104&r2=1840103&pathrev=1840104
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 62808] "function-signature" text containing line breaks causes
JasperException
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62808
--- Comment #2 from Mark Thomas <ma...@apache.org> ---
It is a related issue but not the same. Investigating...
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 62808] "function-signature" text containing line breaks causes
JasperException
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62808
katsuta_k@worksap.co.jp changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|"function-signature" text |"function-signature" text
|coutaining line breaks |containing line breaks
|causes JasperException |causes JasperException
OS| |All
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 62808] "function-signature" text containing line breaks causes
JasperException
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62808
--- Comment #1 from Mark Thomas <ma...@apache.org> ---
There was a regression in 7.0.91 that is fixed for 7.0.92 in this area. I
suspect this is the same issue but need to test it to be sure.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 62808] "function-signature" text containing line breaks causes
JasperException
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=62808
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #3 from Mark Thomas <ma...@apache.org> ---
Fixed in:
- trunk for 9.0.13 onwards
- 8.5.x for 8.5.35 onwards
- 7.0.x for 7.0.92 onwards
Note: This regression only made it into a 7.0.x release.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org