You might think changing the jsp page at $CATALINA_HOME/webapps/ROOT/index.jsp
is all you need to do. This is where I found out it's not the case! The page contents are compiled within the ROOT
web application servlet. To make Tomcat reference the jsp page instead, we need to prevent this servlet from being compiled.
Locate the ROOT web application’s config file at $CATALINA_HOME/webapps/ROOT/WEB-INF/web.xml
, and simply comment out the following code fragment:
<!-- Comment this section so I can change the default index.jsp homepage
<servlet>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<servlet-class>org.apache.jsp.index_jsp</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>org.apache.jsp.index_jsp</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
-->
This will disable the index_jsp
servlet. Now when you restart the Tomcat web application server, it should compile and load the default $CATALINA_HOME/webapps/ROOT/index.jsp
page instead.