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?
Wildcard path for servlet?
10.3k Views Asked by membersound At
2
There are 2 best solutions below
Related Questions in SERVLETS
- Redirect inside java interceptor
- Which Should i use for date,time,email in servlet?
- Importing a downloaded JAR file into a Servlet
- Execute RequestDispatcher after 5 seconds
- What's the difference between a ServletHandler and a ServletContextHandler in Jetty?
- How to call servlet file from html
- Requested Resource is not available error
- Struts exclude pattern with spring
- How can I get a custom header from the client in Tomcat?
- How to print Jasper reports from servlets?
- The type javax.servlet.ServletContext and javax.servlet.ServletException cannot be resolved
- ServletContext Attribute : Thread Safety test not working
- Servlet ClassNotFoundException when present in a package ... Why?
- How to create a PDF with iText+XMLWorker from servlet using custom font?
- Starting a ScheduledExecutorService from a servlet with a set of parameters
Related Questions in WILDCARD
- T SQL wildcard searching for a zip code
- Mysql Wildcard in field
- Use apache mod_mem_cache to cache Rest services
- MySQL wildcard replace
- Excel Advanced Filter not working with Wildcard (* asterisk) using regular numbers and hyphenated number system
- Parameterization Well Formedness and Capture Conversion in Java
- Capture conversion issue in Java, WRT reconciliation of JLS and actual JDK behaviour
- JAVA SQL assign all wildcards to null
- SQL Use Greater/Less Than with like and wildcards
- Why use a wild card capture helper method?
- Wildcards in Standard ML
- excel macro vba Filtering using wildcards
- Use wildcards in ado.net sybase parameter
- Unzip files that begin with a particular string
- Replace function with wildcard
Related Questions in URL-PATTERN
- java.lang.IllegalArgumentException: The servlets are both mapped to the url-pattern [/foo] which is not permitted
- Positional Arguments withDjango url patterns
- decorator() got an unexpected keyword argument
- Django- NoReverseMatch
- Failed to load resource files when mapping Servlet on URL pattern of /
- Servlet mapping 2 url variable
- REST API DESIGN - Getting a resource through REST with different parameters but same url pattern
- Get url-pattern from servlet-name
- Servlet works on Eclipse but not on Tomcat server "The requested resource is not available."
- How to achieve a certain url format using @RequestMapping in SpringMVC
- web.xml servlet mapping infinite loop
- Django: URL pattern translation with gettext
- What's the correct regex for a required string and optional string in Django?
- Webfilter double urlpattern definiton required?
- Omit one parameter from view in Django?
Related Questions in PATH-PARAMETER
- Store @PathParam values from REST call in a list or array
- URL encoding in path parameter with Chi
- In a REST URL what does the meaning for <pathPram>:<xyz> stands for? And how to process it in sprinboot?
- Servlet request.getServletPath
- OpenAPI duplicate paths
- How to get path parameter in spring cloud function
- Get Path Param with HTML + JavaScript
- Wildcard path for servlet?
- How do we pass parameters to a mounted route in nodeJS?
- How to parse request parameter (query and path param) and request body in same POJO in REST API
- location.href is adding a / before pathparam?
- OpenAPI path/query parameters nested structure serialization
- How to match nested path parameter in rest url (spring boot)
- How to pass path param to httptest request
- How To use Patch Method Path Parameter in VB.net
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
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/otherreturn/other.See also: