You can use * as a prefix or suffix. In your case, you can use /myServlet/* to map folders.
@WebServlet("/myServlet/*")
The path information (the part after matching in the URL) is in the servlet, available as:
String pathInfo = request.getPathInfo();
This would be the case with myapp/myServlet/other return /other .
See also:
source share