谷歌Guice谷歌Appengine:映射与工作_ah [英] Google Guice on Google Appengine: mapping with working _ah

查看:145
本文介绍了谷歌Guice谷歌Appengine:映射与工作_ah的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Google Appengine / Guice / Wicket应用程序。我的问题是,由于映射,我无法再访问/ _ah / admin页面。

I have a Google Appengine/Guice/Wicket Application. My problem is that due to the mapping I can't access the /_ah/admin Page anymore.

我的Servlet模块说:

My Servlet Module says:

serve( "/*" ).with( WicketServlet.class, getWicketServletParams() );

到目前为止,访问/ _ah / admin时或多或少都会给404一个提示。

so far it is more or less expected that accessing /_ah/admin gives a 404.

我的问题是我没有找到解决方法。

I problem is that I don't find a workaround.

我尝试了serveRegex()的不同组合,

I tried different combinations of serveRegex(), but even

serveRegex( "/.*" ).with( WicketServlet.class, getWicketServletParams() );

会导致问题,因为Wicket的URL调度会中断。

leads to problems, as the URL dispatching of Wicket gets broken. The application keeps on repeating the Path (e.g. /list becomes /list/list etc.).

有什么想法?

推荐答案

我使用 UrlRewriteFilter 。请查看源代码此处

I solved the same problem with Spring/GAE using the UrlRewriteFilter. Please take a look at the source here. I assume a similar solution could be used for your situation.

<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN" "http://tuckey.org/res/dtds/urlrewrite3.0.dtd">
<urlrewrite>
    <rule>
        <from>^/appstats/(.*)$</from>
        <to last="true">/appstats/$1</to>
    </rule>
    <rule>
        <from>^/_ah/(.*)$</from>
        <to last="true">/_ah/$1</to>
    </rule>
    <rule>
        <from>^/(.*)$</from>
        <to last="true">/app/$1</to>
    </rule>

这篇关于谷歌Guice谷歌Appengine:映射与工作_ah的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆