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

Method validateXmlView

java/org/apache/jasper/compiler/Validator.java:1601–1636  ·  view source on GitHub ↗

Validate XML view against the TagLibraryValidator classes of all imported tag libraries.

(PageData xmlView, Compiler compiler)

Source from the content-addressed store, hash-verified

1599 * Validate XML view against the TagLibraryValidator classes of all imported tag libraries.
1600 */
1601 private static void validateXmlView(PageData xmlView, Compiler compiler) throws JasperException {
1602
1603 StringBuilder errMsg = null;
1604 ErrorDispatcher errDisp = compiler.getErrorDispatcher();
1605
1606 for (Object o : compiler.getPageInfo().getTaglibs()) {
1607
1608 if (!(o instanceof TagLibraryInfoImpl tli)) {
1609 continue;
1610 }
1611
1612 ValidationMessage[] errors = tli.validate(xmlView);
1613 if ((errors != null) && (errors.length != 0)) {
1614 if (errMsg == null) {
1615 errMsg = new StringBuilder();
1616 }
1617 errMsg.append("<h3>");
1618 errMsg.append(Localizer.getMessage("jsp.error.tlv.invalid.page", tli.getShortName(),
1619 compiler.getPageInfo().getJspFile()));
1620 errMsg.append("</h3>");
1621 for (ValidationMessage error : errors) {
1622 if (error != null) {
1623 errMsg.append("<p>");
1624 errMsg.append(error.getId());
1625 errMsg.append(": ");
1626 errMsg.append(error.getMessage());
1627 errMsg.append("</p>");
1628 }
1629 }
1630 }
1631 }
1632
1633 if (errMsg != null) {
1634 errDisp.jspError(errMsg.toString());
1635 }
1636 }
1637}

Callers 1

validateExDirectivesMethod · 0.95

Calls 12

getMessageMethod · 0.95
jspErrorMethod · 0.95
getErrorDispatcherMethod · 0.80
getPageInfoMethod · 0.80
getTaglibsMethod · 0.65
validateMethod · 0.65
getIdMethod · 0.65
getMessageMethod · 0.65
toStringMethod · 0.65
appendMethod · 0.45
getShortNameMethod · 0.45
getJspFileMethod · 0.45

Tested by

no test coverage detected