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: katsut...@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-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org