Question

is there any possibility in Java's web.xml of redirect all subdomains to one servlet?

For example:

<url-pattern>*.</url-pattern>
Était-ce utile?

La solution

You can definitely do that but I think you would like to define your URL pattern using *.ext or *.* as below:

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

This is also used by some populare MVC frameworks such as struts where UL pattern

    <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
   </servlet-mapping>

is mapped to Struts controller servlet.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top