Under Tomcat, directory structure is listed when accessing the directory

Source: Internet
Author: User
Tags apache tomcat

Apache Tomcat 7.0.26 Test

By default, Tomcat is started, if a virtual directory is accessed, such as: Http://localhost/xuni

If, Xuni, the default page is not found in this directory,

Then you'll get a 404 error, and if you want Tomcat to list the directory structure instead of returning 404, you can set it in the following ways


Locate the following code in Apache-tomcat-7.0.26\conf\web.xml and change false to True, and restart Tomcat to take effect


<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>false</param-value >
	</init-param>
	<load-on-startup>1</load-on-startup>
</servlet>


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.