MCPcopy Index your code
hub / github.com/apache/tomcat / parseBody

Method parseBody

java/org/apache/jasper/compiler/Parser.java:1461–1502  ·  view source on GitHub ↗
(Node parent, String tag, String bodyType)

Source from the content-addressed store, hash-verified

1459 * bodyType One of the TagInfo body types
1460 */
1461 private void parseBody(Node parent, String tag, String bodyType) throws JasperException {
1462 if (bodyType.equalsIgnoreCase(TagInfo.BODY_CONTENT_TAG_DEPENDENT)) {
1463 parseTagDependentBody(parent, tag);
1464 } else if (bodyType.equalsIgnoreCase(TagInfo.BODY_CONTENT_EMPTY)) {
1465 if (!reader.matchesETag(tag)) {
1466 err.jspError(start, "jasper.error.emptybodycontent.nonempty", tag);
1467 }
1468 } else if (bodyType.equalsIgnoreCase(TagInfo.BODY_CONTENT_JSP) ||
1469 bodyType.equalsIgnoreCase(TagInfo.BODY_CONTENT_SCRIPTLESS) || (bodyType == JAVAX_BODY_CONTENT_PARAM) ||
1470 (bodyType == JAVAX_BODY_CONTENT_TEMPLATE_TEXT)) {
1471 while (reader.hasMoreInput()) {
1472 if (reader.matchesETag(tag)) {
1473 return;
1474 }
1475
1476 // Check for nested jsp:body or jsp:attribute
1477 if (tag.equals("jsp:body") || tag.equals("jsp:attribute")) {
1478 if (reader.matches("<jsp:attribute")) {
1479 err.jspError(reader.mark(), "jsp.error.nested.jspattribute");
1480 } else if (reader.matches("<jsp:body")) {
1481 err.jspError(reader.mark(), "jsp.error.nested.jspbody");
1482 }
1483 }
1484
1485 if (bodyType.equalsIgnoreCase(TagInfo.BODY_CONTENT_JSP)) {
1486 parseElements(parent);
1487 } else if (bodyType.equalsIgnoreCase(TagInfo.BODY_CONTENT_SCRIPTLESS)) {
1488 parseElementsScriptless(parent);
1489 } else if (bodyType == JAVAX_BODY_CONTENT_PARAM) {
1490 // (note the == since we won't recognize JAVAX_*
1491 // from outside this module).
1492 reader.skipSpaces();
1493 parseParam(parent);
1494 } else if (bodyType == JAVAX_BODY_CONTENT_TEMPLATE_TEXT) {
1495 parseElementsTemplateText(parent);
1496 }
1497 }
1498 err.jspError(start, "jsp.error.unterminated", "&lt;" + tag);
1499 } else {
1500 err.jspError(start, "jasper.error.bad.bodycontent.type");
1501 }
1502 }
1503
1504 /*
1505 * Parses named attributes.

Callers 3

parseOptionalBodyMethod · 0.95
parseJspBodyMethod · 0.95
parseNamedAttributesMethod · 0.95

Calls 13

parseTagDependentBodyMethod · 0.95
parseElementsMethod · 0.95
parseParamMethod · 0.95
matchesETagMethod · 0.80
hasMoreInputMethod · 0.80
jspErrorMethod · 0.65
equalsMethod · 0.65
matchesMethod · 0.65
equalsIgnoreCaseMethod · 0.45
markMethod · 0.45

Tested by

no test coverage detected