In the Web. xml file, how does one perform URL-pattern?

Source: Internet
Author: User

This problem was left at the end of the previous blog. Next we will start to solve the problem. Refer:

Http://www2.roguewave.com/support/docs/leif/leif/html/bobcatug/7-3.html

Http://foxty.javaeye.com/blog/39332

Http://blog.chinaunix.net/u2/86974/showart_1776019.html

10.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.

• A string beginning with a '*.' prefix is used as an extension mapping.

• All other strings are used as exact matches only


A string containing only the '/' character indicates that Servlet
Specified by the mapping becomes the "default" servlet of
Application.

For example,Web. xml

File forExamples

Context on the serverExample.com

Matches the pattern in<URL-pattern>/status/* </url-pattern>

As follows:

Http://example.com/examples/status/synopsis

Matches

Http://example.com/examples/status/complete? Date = today

Matches

Http://example.com/examples/status

Matches

Http://example.com/examples/server/status

Does not match

A context located at the path/Examples

On the server at example.com matches the pattern in<URL-pattern> *. Map </url-pattern>

As follows:

Http://example.com/examples/US/Oregon/Portland.map

Matches

Http://example.com/examples/US/Washington/Seattle.map

Matches

Http://example.com/examples/Paris.France.map

Matches

Http://example.com/examples/US/Oregon/Portland.MAP

Does not match, the extension is uppercase

http://example.com/examples/interface/description/mail.mapi

does not match, the extension is mapi

rather than Map


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.