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

Method execute

java/org/apache/jasper/JspC.java:1500–1638  ·  view source on GitHub ↗

Executes the compilation.

()

Source from the content-addressed store, hash-verified

1498 * Executes the compilation.
1499 */
1500 @Override
1501 public void execute() {
1502 if (log.isDebugEnabled()) {
1503 log.debug(Localizer.getMessage("jspc.start", Integer.toString(pages.size())));
1504 }
1505
1506 try {
1507 if (uriRoot == null) {
1508 if (pages.isEmpty()) {
1509 throw new JasperException(Localizer.getMessage("jsp.error.jspc.missingTarget"));
1510 }
1511 String firstJsp = pages.get(0);
1512 File firstJspF = new File(firstJsp);
1513 if (!firstJspF.exists()) {
1514 throw new JasperException(Localizer.getMessage("jspc.error.fileDoesNotExist", firstJsp));
1515 }
1516 locateUriRoot(firstJspF);
1517 }
1518
1519 if (uriRoot == null) {
1520 throw new JasperException(Localizer.getMessage("jsp.error.jspc.no_uriroot"));
1521 }
1522
1523 File uriRootF = new File(uriRoot);
1524 if (!uriRootF.isDirectory()) {
1525 throw new JasperException(Localizer.getMessage("jsp.error.jspc.uriroot_not_dir"));
1526 }
1527
1528 if (loader == null) {
1529 loader = initClassLoader();
1530 }
1531 if (context == null) {
1532 initServletContext(loader);
1533 }
1534
1535 // No explicit pages, we'll process all .jsp in the webapp
1536 if (pages.isEmpty()) {
1537 scanFiles();
1538 } else {
1539 // Ensure pages are all relative to the uriRoot.
1540 // Those that are not will trigger an error later. The error
1541 // could be detected earlier but isn't to support the use case
1542 // when failFast is not used.
1543 for (int i = 0; i < pages.size(); i++) {
1544 String nextjsp = pages.get(i);
1545
1546 File fjsp = new File(nextjsp);
1547 if (!fjsp.isAbsolute()) {
1548 fjsp = new File(uriRootF, nextjsp);
1549 }
1550 if (!fjsp.exists()) {
1551 if (log.isWarnEnabled()) {
1552 log.warn(Localizer.getMessage("jspc.error.fileDoesNotExist", fjsp.toString()));
1553 }
1554 continue;
1555 }
1556 String s = fjsp.getAbsolutePath();
1557 if (s.startsWith(uriRoot)) {

Callers 1

mainMethod · 0.95

Calls 15

getMessageMethod · 0.95
locateUriRootMethod · 0.95
initClassLoaderMethod · 0.95
initServletContextMethod · 0.95
scanFilesMethod · 0.95
initWebXmlMethod · 0.95
completeWebXmlMethod · 0.95
mergeIntoWebXmlMethod · 0.95
releaseMethod · 0.95
lengthMethod · 0.80
isDebugEnabledMethod · 0.65
debugMethod · 0.65

Tested by

no test coverage detected