Tony the Pony
Tony the Pony

Reputation: 41417

How to route ALL requests to a specific servlet?

Configuring servlets in web.xml usually follows this pattern:

http://www.mydomain.com/servletName/some/path/here

What configuration do I use if I want all requests to go to the same servlet?

http://www.mydomain.com/some/path/here

Upvotes: 2

Views: 4787

Answers (1)

Buhake Sindi
Buhake Sindi

Reputation: 89189

Point your <url-pattern> in web.xml to your servlet like so:

<servlet-mapping>
        <servlet-name>myservlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>

Upvotes: 9

Related Questions