【问题标题】:Guice servlet DSL, filter all but one URLGuice servlet DSL,过滤除一个 URL 之外的所有 URL
【发布时间】:2010-07-05 16:20:33
【问题描述】:

我想通过我的“SecurityFilter”过滤对我的 Web 应用程序的所有请求,它检查会话变量“authToken”是否有效。问题是为了获得这个令牌,你需要点击 /auth 中的“AuthServlet”。

我需要使用我的“SecurityFilter”过滤除 /auth servlet 之外的所有 servlet。我怎样才能通过 guice-servlet 做到这一点?

我想尝试无济于事......

filterRegex("!((.)*auth(.)*)").through(PortSecurityFilter.class);

【问题讨论】:

    标签: java servlets guice


    【解决方案1】:

    ^((?!/authorize).)*$ 工作。

    【讨论】:

      猜你喜欢
      • 2018-11-20
      • 2011-04-20
      • 2013-05-10
      • 2019-04-23
      • 2016-10-17
      • 2019-09-29
      • 1970-01-01
      • 2020-11-27
      • 1970-01-01
      相关资源
      最近更新 更多