开发者

Guice servlet DSL, filter all but one URL

开发者 https://www.devze.com 2023-01-05 23:24 出处:网络
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

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

精彩评论

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