stay Tomcat In the installation directory ,webapps The default is the directory to deploy the website .webapps/ROOT It's the root of the website , Other directories are subdirectories of the website , Such as webapps\jsp-examples Catalog . however , When we create a new subdirectory , But it can't be accessed in the browser . Even HTML Files are inaccessible . Why does this happen ?

original , stay Tomcat in , every last webapps All subdirectories under are considered to be a JSP Site . therefore , The subdirectory must have JSP The necessary structure of the site . That is to say , Under the created subdirectory , There must be WEB_INF Directory and WEB_INF Under the web.xml file .WEB_INF The directory and the web.xml file , yes JSP Used to configure the site .

With test Take subdirectories as an example , Here is the correct configuration Tomcat Directory structure of subdirectories :

webapps\
            ┝ ROOT\
            │        │
            │        ┕ …
            ┕ test\
                        │
                        ┝ index.html
                        │
                        ┕ WEB_INFO\
                                    │
                                    ┕  web.xml

Empty web.xml The contents of the document are 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 may not use this file except in compliance with the License.
  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "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-app xmlns="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>

 
 

Why? Tomcat Of webapps The new directory under the directory cannot be accessed html file ? More articles about

  1. Linux Under the environment variable setting skills , no need /etc/profile But in /etc/profile.d Create a new specific shell File to set up

    difference : 1. Both files are used to set environment variables ,/etc/profile It's a permanent environment variable , Global variable ,/etc/profile.d/ Set all users to take effect , It's also a permanent variable , Global variable . 2./etc/prof ...

  2. php In the catalog ext Directory , Executed command

    php In the directory of ext Catalog , If you only need a basic extension framework , Execute the following command : ./ext_skel --extname=module_name module_name It's the name of the extension module you can choose ...

  3. Visual Studio Project directory bin Contents and obj Catalog

    One .Bin Catalog Visual Studio Compile time , stay bin Directory is debug and release Catalog . 1.Debug: Usually called debug version , It contains debugging information , So it's better than Release It's a lot bigger ( can ...

  4. linux Compile below qt5.6.0 Static library ( Use ./configure --help Let's see what the parameters are . Hyperdetail , There is a description of each module . If you change the installation directory , You need to go to... Under the installation directory bin Create files in directory qt.conf)( The mob )good

    linux Compile below qt5.6.0 Static library linux Compile below qt5.6.0 Static library configure Generate makefile Installation options Configure Options Third party Library : Additional options : QNX/Blackberr ...

  5. 【Android Studio Install deployment series 】 sixteen 、Android studio stay layout Create a new subdirectory under the directory

    Copyright notice : This paper is about HaiyuKing Original article , Reprint please indicate the source ! summary It is generally used to classify and display different modules layout Layout file . stay res/layout Create a subdirectory under the folder res/layout Right mouse button ——New— ...

  6. About JAVA EE The project in WEB-INF In the catalog jsp How to access the page WebRoot Medium CSS and JS file

    Looking for information for so long , It's settled Thank you blog Park :http://www.cnblogs.com/xsht/p/5275081.html Thank you Baidu :http://zhidao.baidu.com/link?url ...

  7. Why? Visual Studio The installation directory of is named 1033 or 2052 Folder ?

    It's not clear MS Why is there always an installation directory named 1033 perhaps 2052 The catalog of Just search for it , Originally called  LCID(Locale ID, Culture identifier ) The common ones are :1033 It means English ( The United States ),2052 Expressing Chinese ...

  8. use Python Delete files created before a certain point in time in the local directory

    Reference resources http://www.cnblogs.com/iderek/p/8035757.html os.listdir(dirname): List dirname Directory and files under os.getcwd(): Get the current ...

  9. python Look in the directory A file with a string in its name

    Where there are pits : If the code is written like this : [( os.path.abspath(x)) for x in os.listdir(startPath) ] This code can only be used in the current directory ,listdir All that's listed are essays ...

Random recommendation

  1. oracle number Type date to date Type date

    When it comes to databases , Found a field like this , The type is NUMBER(38), Look at the data , It's all like this , 13239576781141321326994295132212930680413221297162 ...

  2. phpstorm The configuration code is automatically synchronized to the server

    First find your menu bar and find Tools Then click Configure Fill in your server information Fill in the project catalog Choose auto upload

  3. 20160824_CentOS6.4x64_ close IPv6

    1. Refer to the website : http://blog.csdn.net/suplxj/article/details/7773423 2. My operation : #cat <<EOF>>/etc/mod ...

  4. WPS Remove the initial caps and correct them automatically when typing

    1. Click the menu option in the upper left corner 2. Select “ Options ” Button

  5. Forget to import struts2-xxx-plugin-x.x.x.jar Causes the server to start reporting Unable to load configuration.Caused by: Parent package is not defined: xxx-default

    Today's one Struts2+MyFaces(JSF)+Spring Application , In order to use JSF, my struts.xml The following code is used in <package name="jsf" e ...

  6. How do I place a group of functions or variables in a specific section?

    http://supp.iar.com/Support/?Note=27498 EWARM v5.xx (and newer) The placement of a few functions in ...

  7. Grant remote desktop connection to ordinary domain users DC/ Client permissions

    Ordinary domain users log in through remote desktop DC: 1) Add the user to Remote Desktop Users  In the group

  8. fcntl,F_GETFL,F_SETFL,flags

    1. retrievable flags, namely open The second parameter of the function : flags = fcntl(fd,F_GETFL,0); 2. Set the flags: fcntl(fd,F_SETFL,flags); 3. increase ...

  9. DDB And DIB The difference between

    DDB( Device related bitmap ) DDB Depending on the device :DDB The color mode of must be consistent with the output device . for example , If the current display device is 256 Color mode , that DDB It must be 256 Chromatic . stay 256 The pixel values stored in bitmaps below color are the system palette ...

  10. Get along well with Web And JavaScript( 3、 ... and )-----javaScript Grammar summary ( 3、 ... and ) window / Scroll bar / The grammar of the text

    JS Grammar collection ( 3、 ... and ) window / Scroll bar / Text alert(" Text ")    Warning box : Warning boxes are often used to ensure that users can get some information , When the warning box appears , The user needs to click OK to continue . con ...