How do I specify one or more matches in a URL pattern?

"/*" will match zero or more characters. I want to execute a query if there is one or more characters continuing the "/" character.

Note. I am using the Guice Servlet module to configure the request.

Thanks!

0
source share
2 answers

I think you can just do it, assuming you want to match something with / and 1 or more characters after it (like /foo and /a , but not / ).

 serveRegex("/.+") 
+1
source

in general regex:

 /+ 

I don’t know if he works hard here.?

http://code.google.com/p/google-guice/wiki/ServletRegexKeyMapping

0
source

Source: https://habr.com/ru/post/897482/


All Articles