Configuration of Servlet-mapping Url-pattern in Web. xml

Source: Internet
Author: User

In the configuration of Web. XML servlet-mapping Url-pattern Encounter problems, surf the internet, find out servelt2_2-spec.pdf to get the answer.

Conclusion:
? '/xxx/* '
? ' *.html '
? '/'
? all the others are precisely mapped
Example: '/xxx/y*.html ' can only map/xxx/y*.html URL requests.
Example: '/xxx ' can only map/xxx URL requests.

References10.2 specification of MAPPINGS 
In the Web application Deployment descriptor, the following syntax is used to define MAPPINGS: 
? A string beginning with a '/' character and ending with a '/* * ' postfix is used as a path 
mapping. 

Translate as follows:
10.2 Mapping Rule Description
In the deployment description (Web. xml) of your application, the following syntax structure is used to define the mappings:
? A string beginning with '/' and ending with '/* ' is used to map the path.
? With ' *. ' The initial mapping used to do the extension.
? All other strings are precisely mapped.
? A string that is just '/' will present this servlet explicitly as the default servlet for the app.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Configuration of Servlet-mapping Url-pattern in Web. xml

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.