【发布时间】:2023-03-17 13:16:01
【问题描述】:
我正在使用带有 Google App Engine 插件和 Guice 的 Eclipse IDE。在开发服务器上运行,我在 web.xml 和 guice MyServletModule extends ServletModule 中尝试了这两种方法:
<url-pattern>/user/*</url-pattern>
和
filter("/user/*").through(LoginFilter.class);
两者似乎都适用
http://www.domain.com/user/
但是......似乎都不适用于:
http://www.domain.com/user/myaccount.html
知道为什么吗?根据文档,/user/* 应该适用于两者,对吧?
...我怀疑它与 itaself 文件有关,因为我似乎也无法过滤 "*.html"。
编辑:已解决。叹息......我在 GAE/J 文档中发现了这个花絮:
"Note: Filters are not invoked on static assets, even if the path matches a filter-mapping pattern. Static files are served directly to the browser."
【问题讨论】:
标签: google-app-engine servlet-filters web.xml