I am attempting to port a (very old) app from Tomcat 9 to Tomcat 11, using
the new servlet/JSP package names. The app is built using an (even older)
Ant build script that uses JSPC to precompile the JSPs. One webapp builds
correctly, but the second fails - precompilation apparently succeeds, but
the compiled JSPs use the "old" javax.servlet packages instead of the newer
jakarta.servlet packages. Here's brief excerpt of the ant output:
[jasper2] Nov 27, 2025 7:46:25 AM org.apache.jasper.servlet.TldScanner
scanJars
[jasper2] INFO: At least one JAR was scanned for TLDs yet contained no
TLDs. Enable debug logging for this logger for a complete list of JARs that
were scanned but no TLDs were found in them. Skipping unneeded JARs during
scanning can improve startup time and JSP compilation time.
[jasper2] Nov 27, 2025 7:46:25 AM org.apache.jasper.JspC processFile
[jasper2] INFO: Built file [/jsp/main/afvHome.jsp]
[jasper2] Nov 27, 2025 7:46:25 AM org.apache.jasper.JspC execute
[jasper2] INFO: Generation completed with [0] errors in [6] milliseconds
[javac] Compiling 1 source file to
C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\build\jsp
[javac]
C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\src\jsp\net\afva\jsp\main\afvHome_jsp.java:24:
error: package javax.servlet.jsp does not exist
[javac] private static final javax.servlet.jsp.JspFactory _jspxFactory =
[javac] ^
[javac]
C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\src\jsp\net\afva\jsp\main\afvHome_jsp.java:108:
error: package javax.el does not exist
[javac] private volatile javax.el.ExpressionFactory _el_expressionfactory;
[javac] ^
[javac]
C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\src\jsp\net\afva\jsp\main\afvHome_jsp.java:123:
error: package javax.el does not exist
[javac] public javax.el.ExpressionFactory _jsp_getExpressionFactory() {
[javac] ^
[javac]
C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\src\jsp\net\afva\jsp\main\afvHome_jsp.java:261:
error: package javax.servlet.http does not exist
[javac] public void _jspService(final javax.servlet.http.HttpServletRequest
request, final javax.servlet.http.HttpServletResponse response)
[javac] ^
[javac]
C:\Users\LUKE~1.MAD\AppData\Local\Temp\afv\src\jsp\net\afva\jsp\main\afvHome_jsp.java:261:
error: package javax.servlet.http does not exist
[javac] public void _jspService(final javax.servlet.http.HttpServletRequest
request, final javax.servlet.http.HttpServletResponse response)
[javac] ^
Why does JSPC use the "old" package names, and is there anything I can do
to force it? Again, the other webapp seems to work correctly, but I am
unsure of the differences.
Thanks in advance