You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by lu...@apache.org on 2003/01/11 01:51:36 UTC
cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler Parser.java
luehe 2003/01/10 16:51:36
Modified: jasper2/src/share/org/apache/jasper/compiler Parser.java
Log:
Fixed 15966: Jasper parser is incorrectly handling empty jsp:body elements
Revision Changes Path
1.55 +11 -29 jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java
Index: Parser.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/Parser.java,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- Parser.java 11 Jan 2003 00:11:06 -0000 1.54
+++ Parser.java 11 Jan 2003 00:51:36 -0000 1.55
@@ -1597,38 +1597,20 @@
}
/*
- * JspBodyBody ::= ( S? '>'
- * ( ( ScriptlessBody
- * | Body
- * | TagDependentBody
- * ) - ''
- * ) '</jsp:body>'
- * )
- * | ( ATTR[ !value ] S? JspBodyEmptyBody )
- *
- * JspBodyEmptyBody ::= '/>'
- * | '></jsp:body>'
- * | <TRANSLATION_ERROR>
- *
+ * Parses jsp:body action.
*/
private void parseJspBody(Node parent, String bodyType)
throws JasperException
{
Mark start = reader.mark();
- reader.skipSpaces();
-
- if (!reader.matches(">")) {
- err.jspError(reader.mark(),
- "jsp.error.attributes.not.allowed",
- "<jsp:body>" );
- }
-
Node bodyNode = new Node.JspBody(start, parent);
- if( reader.matches( "</jsp:body>" ) ) {
- // Body was empty. This is illegal, according to the grammar.
- err.jspError(reader.mark(),"jsp.error.empty.body.not.allowed",
- "<jsp:body>" );
- } else {
+
+ reader.skipSpaces();
+ if (!reader.matches("/>")) {
+ if (!reader.matches(">")) {
+ err.jspError(start, "jsp.error.unterminated",
+ "<jsp:body");
+ }
parseBody( bodyNode, "jsp:body", bodyType );
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>