How can I configure a web application so that .jsp files in subdirectories can find the same classes as .jsp files in the application's root directory?
I have moved an old web application from a tomcat6 server to a tomcat9 server. However, .jsp files in subdirectories of the app are no longer able to import java classes that are under WEB-INF/classes. The web app is installed as an exploded war file. To demonstrate the problem I have a test.jsp file that just contains:
<%@ page import="com.example.serverutils.StringUtil" %>
<%= StringUtil.MILLISECONDS_PER_DAY %>
This file compiles fine when it is in the application's root directory. But if I move test.jsp to a subdirectory, it is unable to find the StringUtil class.
The directory structure is as follows:
domain\test.jsp
domain\sub\test.jsp
domain\WEB-INF\web.xml
domain\WEB-INF\classes\com\example\serverutils\StringUtil.class
The actual error being logged is "Only a type can be imported. com.example.serverutils.StringUtil resolves to a package"