View tomcat configuration file

Source: Internet
Author: User

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.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.