Having an @WebServlet(urlPatterns = "/myServlet/")
. If the user goes to myapp/myServlet/other
, I still want my servlet to catch. So to say, wildcard anything on after the servlet path. How could I do this?
相关问题
- how to create files under /WEB-INF/
- tomcat websocket servlet listening port
- Using regular expressions for filter-mapping
- If current page URL equals X OR X?
- SQL LIKE Column Value Plus Wildcard DB2
相关文章
- java.lang.NoClassDefFoundError: javax/servlet/http
- Forward request from servlet to jsp
- Intercept @RequestHeader exception for missing hea
- Integrating Jetty with RESTEasy
- How to abort Tomcat startup upon exception in Serv
- XML Parsing Error in Firefox developer console
- servlet request parameter character encoding
- Resolving relative paths with wildcards in C#
You can use
*
as prefix or suffix wildcard. In your case, you can use/myServlet/*
for a folder mapping.The path info (the part after the mapping in the URL) is in the servlet by the way available as:
This would in case of
myapp/myServlet/other
return/other
.See also:
use "/myServlet/*" as your servlet mapping.