According to the Servlet Specification, URL patterns ending in "/ *" will match all requests to the previous path. So, as you did, you will need to enter the following url to go to abcDefServlet:
http://myapp.com/server/abcDef/*/<wildcard>
What you can do is add multiple URL patterns in one servlet mapping. For example:
<servlet-mapping> <servlet-name>abcDefServlet</servlet-name> <url-pattern>/server/abcDef/1432124/*</url-pattern> <url-pattern>/server/abcDef/abcd/*</url-pattern> </servlet-mapping>
Update:
Since 1432124 and abcd are not fixed values, you can safely add the following mapping:
<servlet-mapping> <servlet-name>abcDefServlet</servlet-name> <url-pattern>/server/abcDef/*</url-pattern> </servlet-mapping>
And then handle any values ββthat appear after abcDef inside the servlet itself, with the following function:
req.getPathInfo()
Cassio
source share