How to indicate one or more match in url pattern?

帅比萌擦擦* 提交于 2019-12-13 22:18:33

问题


"/*" 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!


回答1:


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("/.+")



回答2:


in general regex:

/+

dont know if it works here tough ..?

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



来源:https://stackoverflow.com/questions/7447885/how-to-indicate-one-or-more-match-in-url-pattern

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!