Web.xml: Are url template tags relative to each other?

   <servlet-mapping>
      <servlet-name>myName</servlet-name>
      <url-pattern>/aName</url-pattern>
   </servlet-mapping>

    <security-constraint>

            <web-resource-collection>

                    ...

                    <url-pattern>
                            /*
                    </url-pattern>

            </web-resource-collection>

             ...

    </security-constraint>

This is an excerpt from web.xml (using it to configure jboss / tomcat web service). Just wondering whether url-patternin is web-resource-collectionrelative url-patternto servlet-mapping.

+3
source share
3 answers

url-patternused to select the restrictions for this request does not apply to anything. The interesting parts of the servlet specification are:

SRV.12.8.3 Processing Requests

, SRV.11.1, ( ), url-pattern, URI . , . , HTTP . , . , , http-method url-pattern. : .

SRV.11.1 URL

- - . - , URL- . URL- .

- , .

, , - URL- . URL . :

  • . .
  • . , / . .
  • URL (,.jsp), , . . char - Acter.
  • , , . " " , .

SRV.11.2

- :

  • , '/ '/*   .
  • , '*. .
  • , /, " "  . URI , null.
  • .
+6

, security-constraint/web-resource-collection/url-pattern /url- : web.xml, , -/url- , URI, . ( - tomcat).

+5

, ; - . URL, HTTP- (GET, POST,...), .

. , SRV.12.8 url-pattern.

+1
source

Source: https://habr.com/ru/post/1742844/


All Articles