开发者

Guice servlet DSL, filter all but one URL

I want to filter all requests to my web application through my "SecurityFilter" which checks that a session variable "authToken" is valid. The problem is that in order to get this token you need to hit the "AuthServlet" which is at /auth.

I need to filter all servlets except the /auth servlet with my "SecurityFilter". How can I do this via guice-servlet?

I thought of trying to no avail...

filterRegex("!((.)*auth(.)*)").through(P开发者_StackOverflow社区ortSecurityFilter.class);


^((?!/authorize).)*$ worked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜