kinman 01/10/03 12:29:28
Modified: jasper/src/share/org/apache/jasper/compiler Parser.java
Log:
PR: Bugzilla 3845
Revision Changes Path
1.15 +8 -8
jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/Parser.java
Index: Parser.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-4.0/jasper/src/share/org/apache/jasper/compiler/Parser.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Parser.java 2001/09/20 21:47:32 1.14
+++ Parser.java 2001/10/03 19:29:28 1.15
@@ -834,20 +834,16 @@
- if (reader.matches(CLOSE_1)
- || bc.equalsIgnoreCase(TagInfo.BODY_CONTENT_EMPTY)) {
- if (reader.matches(CLOSE_1))
- reader.advance(CLOSE_1.length());
- else
- throw new ParseException(start, "Body is supposed to be empty for
"+tag);
-
- listener.setTemplateInfo(parser.tmplStart, parser.tmplStop);
+ if (reader.matches(CLOSE_1)) {
+ reader.advance(CLOSE_1.length());
+ listener.setTemplateInfo(parser.tmplStart, parser.tmplStop);
listener.handleTagBegin(start, reader.mark(), attrs, prefix,
shortTagName, tli, ti, true);
listener.handleTagEnd(start, reader.mark(), prefix,
shortTagName, attrs, tli, ti, true);
} else {
// Body can be either
+ // - empty
// - JSP tags
// - tag dependent stuff
if (reader.matches(CLOSE)) {
@@ -861,12 +857,16 @@
if (bodyStop != null) {
String bodyString = new String(reader.getChars(bodyStart,
bodyStop));
hasBody = (bodyString.length() > 0);
+ if (hasBody &&
bc.equalsIgnoreCase(TagInfo.BODY_CONTENT_EMPTY))
+ throw new ParseException(start,
+ "Body is supposed to be empty for "+tag);
}
reader.reset(bodyStart);
listener.handleTagBegin(start, bodyStart, attrs, prefix,
shortTagName, tli, ti, hasBody);
if (bc.equalsIgnoreCase(TagInfo.BODY_CONTENT_TAG_DEPENDENT) ||
+ bc.equalsIgnoreCase(TagInfo.BODY_CONTENT_EMPTY) ||
bc.equalsIgnoreCase(TagInfo.BODY_CONTENT_JSP))
{
// Parse until the end of the tag body.