开发者

Using a URL exclusion pattern / Running App Engine in dev mode with Guice

开发者 https://www.devze.com 2022-12-19 22:05 出处:网络
I\'m using GAE and Guice, but I\'m running into problems on the dev server. This is my web.xml <filter>

I'm using GAE and Guice, but I'm running into problems on the dev server. This is my web.xml

<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>

Everything works great until开发者_JAVA百科 I decide to login, at which point it throws up a 404 cause it can't handle pages that start with /_ah. This means I can't do logins on the dev server or look at the admin console.

Any ideas? I can't find how to add an exclusion filter to the URL matcher, and don't know which servlet GAE uses to serve development login and console :-/


Figured it out... I'm using regex to serve only my pages and ignore _ah requests.

serveRegex("/[\\w]+").with(MainServlet.class);


This is what worked for me.

// ignore _ah
serveRegex("^/(?!_ah.*)").with(HomeServlet.class);
0

精彩评论

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