Hitachi

uCosminexus Application Server Compatibility Guide


5.3.2 Types of URL patterns and priority of applicable patterns

This section describes the types of URL patterns that you can specify for URL mapping of the Redirector and the priority of applicable patterns.

Organization of this subsection

(1) Types of URL patterns

You can specify the following four types of URL patterns for the URL mapping of the redirector:

(2) Priority of applicable patterns

Among the mapping to these four URL patterns, the URL pattern with the highest priority is Complete path specification. When the URL does not match with Complete path specification, path matching is judged in the following order, and the applicable URL pattern is decided:

  1. When the URL does not match with Complete path specification

    The longest matching URL pattern from among Path specification, Extension specification, and Suffix specification is applied. Longest match refers to the longest matching URL from the beginning ("/") until the high order path of "*".

    The URL in which the following two mappings are defined is illustrated below as an example:

    Mapping definition:

    /examples/* worker1

    /examples/jsp/* worker2

    In this case, when the URL is /examples/jsp/index.jsp, the mapping of worker2 is applied, and when the URL is /examples/test/index.jsp, the mapping of worker1 is applied.

  2. In addition to the conditions of 1, when multiple longest matching Path specification, Extension specification, and Suffix specification URL patterns are present

    Extension specification or Suffix specification is given priority over Path specification.

    The URL in which the following two mappings are defined is illustrated below as an example:

    Mapping definition:

    /examples/jsp/* worker1

    /examples/jsp/*.jsp worker2

    In this case, when the URL is /examples/jsp/index.jsp, the mapping of worker2 is applied, and when the URL is /examples/jsp/test.html, the mapping of worker1 is applied.

  3. In addition to the conditions of 1 and 2, when multiple longest matching Extension specification and Suffix specification URL patterns are present

    The URL pattern specified later is given priority.

    The URL in which the following two mappings are defined is illustrated below as an example:

    Mapping definition:

    /examples/*.jsp worker1

    /examples/*jsp worker2

    When URL is specified in this order, the mapping of worker2 is applied when the URL is /examples/jsp/index.jsp.

    Important note

    You must note the following points when judging the priority of applicable patterns:

    • If a request URL includes a query (string after a "?" mark in the URL), the query part is not used when comparing with the URL pattern.

      Example:

      If the request URL is /examples/jsp/index.jsp?query=foo, the URL used for comparison is /examples/jsp/index.jsp.

    • If a request URL includes a parameter (string from a semicolon (;)), the parameter part is not used when comparing with the URL pattern.

      Example:

      If the request URL is /examples/jsp/index.jsp;jsessionid=0000, the URL used for comparison is /examples/jsp/index.jsp.

    • A request URL path is first normalized and then the URL is compared with the URL pattern to judge whether both the URLs match.

      Example:

      If a request URL is /examples/../examples/./jsp//index.jsp, the URL used for comparison is /examples/jsp/index.jsp.

    • A URL pattern is never normalized. Therefore, a URL pattern that includes ./ or ../ does not match with the request URL.

    • In Windows, an extension of a URL pattern specified in the Extension specification is not case sensitive.