Search code examples
javaregexguicedeployment-descriptor

How to indicate one or more match in url pattern?


"/*" will match zero or more characters. I want to serve request if there is a one or more characters proceeding the "/" character.

Note: I am using Guice's Servlet Module to configure the request.

Thanks!


Solution

  • I think you can just do this, assuming you mean that you want to matching anything with a / and 1 or more characters after it (so /foo and /a but not /).

    serveRegex("/.+")