Reputation: 5
is there any possibility in Java's web.xml of redirect all subdomains to one servlet?
For example:
<url-pattern>*.</url-pattern>
Upvotes: 1
Views: 683
Reputation: 34387
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.
Upvotes: 1