まず、私は Google AppEngine と Guice を使用していますが、私の問題はこれらとは関係がないと思われます。
ユーザーが私の (GWT) webapp に接続すると、URL は直接の html ページになります。たとえば、開発モードでは次のようになりますhttp://127.0.0.1:8888/Puzzlebazar.html?gwt.codesvr=127.0.0.1:9997
。今、私web.xml
は次のように設定しました:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<display-name>PuzzleBazar</display-name>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>Puzzlebazar.html</welcome-file>
</welcome-file-list>
<filter>
<filter-name>guiceFilter</filter-name>
<filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>guiceFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--
This Guice listener hijacks all further filters and servlets. Extra
filters and servlets have to be configured in your
ServletModule#configureServlets() by calling
serve(String).with(Class<? extends HttpServlet>) and
filter(String).through(Class<? extends Filter)
-->
<listener>
<listener-class>com.puzzlebazar.server.guice.MyGuiceServletContextListener
</listener-class>
</listener>
</web-app>
そして私appengine-web.xml
は:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>puzzlebazaar</application>
<version>1</version>
<sessions-enabled>true</sessions-enabled>
<!-- Configure java.util.logging -->
<system-properties>
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/>
</system-properties>
</appengine-web-app>
私は Guice を使用しているため、ServletModule で追加のフィルターを構成する必要があります。
filter("*.html").through( SecurityCookieFilter.class );
しかし、私SecurityCookieFilter.doFilter
は決して呼び出されません。"*.html*"
orのようなことを試し<url-pattern>*</url-pattern>
ましたが、役に立ちませんでした。これをどのように行うべきか考えていますか?