When Tomcat 5.0 is used, configure the virtual directory test. when accessing the virtual directory test, it will list all the files in the directory test, but after Tomcat 5.5, it will report the 404 error, the file is not found! Enter the full name, for example, http: // localhost: 8080/test/hello. JSP is displayed normally, but index exists. when you enter http: // localhost: 8080/test/In the JSP file, the index is displayed. JSP content, instead of prompting that the file is not found.
This may be because it is not displayed by default for security considerations after atat5.5, because when there is no home page file, all the files on the site will be exposed to the user. We recommend that you disable this function when publishing.
Modify the Tomcat site configuration file web. XML as follows:
<Servlet>
<Servlet-Name> default </servlet-Name>
<Servlet-class> org. Apache. Catalina. servlets. DefaultServlet </servlet-class>
<Init-param>
<Param-Name> debug </param-Name>
<Param-value> 0 </param-value>
</Init-param>
<Init-param>
<Param-Name> listings </param-Name>
<Param-value> true </param-value>
</Init-param>
<Load-on-startup> 1 </load-on-startup>
</Servlet>
Modify the red packet to complete the configuration.