Why does the new directory under Tomcat's WebApps directory not have access to the HTML file?

Source: Internet
Author: User

In the Tomcat installation directory, WebApps defaults to the directory used to deploy the Web site. Webapps/root is the root of the Web site, and other directories are subdirectories of the site, such as the Webapps\jsp-examples directory. However, when we create a new subdirectory, we do not have access to the browser normally. Even HTML files cannot be accessed. Why does this happen?

It turns out that in Tomcat, every subdirectory under the WebApps is considered a JSP site. Therefore, this subdirectory must have the necessary structure of the JSP site. That is, in the subdirectory created, you must have the Web_inf directory and the Web. xml file under Web_inf. The Web_inf directory, and the Web. xml file under it, is used by JSP to configure the site.

For example, in the test subdirectory, the following is the correct configuration of the directory structure for the Tomcat subdirectory:

webapps\
┝root\
││
│┕ ...
test\

index.html

web_info\

Web. XML


The empty Web. xml file reads as follows:

<?XML version= "1.0" encoding= "Iso-8859-1"?><!--Copyright 2004 the Apache software Foundation Licensed under the Apache License, Version 2.0 (the "License");  You are not a use of this file except in compliance with the License.  Obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 unless required by applicable or agreed to writing, software distributed under the License are distributed on a "as is" BASIS, without warranties  or CONDITIONS of any KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -<Web-appxmlns= "HTTP://JAVA.SUN.COM/XML/NS/J2EE"Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"xsi:schemalocation= "Http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"version= "2.4">  <Display-name>Welcome to Tomcat</Display-name>  <Description>Welcome to Tomcat</Description></Web-app>

Thanks http://www.cnblogs.com/legendry/archive/2006/04/27/386508.html

Why does the new directory under Tomcat's WebApps directory not have access to the HTML file?

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.