Welcome-file in Web. XML (configure the default access file when accessing the relative path)

Source: Internet
Author: User

What about the legendary Beijing?

--- Xingyunpi

In JSP web project, the keyword file name can be configured in web-inf. in general, the keyword is index.html.

Problems:

First, go to atathome/CONF/server. A virtual directory admin is configured in XML. sorina, pointing to a folder in the project, such as test (project name)/Webmaster/admin/. At this time, Access Admin. SORINA/ingress. However, use a relative path for access, such as Access:Admin. Sorina/login/At the same time, my goal is to accessTest (project name)/Webmaster/admin/login/list_1_1.html,However404Error.

Solution:

It seems that using this method of relative path access to configure welcome-file is not feasible.Tomcathome/CONF/Web. xml. The default value is:

<Welcome-file-List> <welcome-File> index.html </welcome-File> <welcome-File> index.htm </welcome-File> <welcome-File> index. JSP </welcome-File> </welcome-file-List>

Changed:

 
<Welcome-file-List> <welcome-File> index.html </welcome-File> <welcome-File> index.htm </welcome-File> <welcome-File> list_detail 1.html </welcome -File> <welcome-File> index. JSP </welcome-File> </welcome-file-List>

At the same timeWEB-INF/Web. xmlConfigure:

<Welcome-file-List> <welcome-File> index. JSP </welcome-File> <welcome-File> list_00001.html </welcome-File> <welcome-File> index.html </welcome-File> </welcome-file-List>

In this way, access is normal.

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.