Google app engine 使用dispatch.xml在自定义域下路由非默认模块的根 关于使用默认模块的dispatch.xml功能的文档不完整:
我有以下Google app engine 使用dispatch.xml在自定义域下路由非默认模块的根 关于使用默认模块的dispatch.xml功能的文档不完整:,google-app-engine,Google App Engine,我有以下dispatch.xml: <?xml version="1.0" encoding="UTF-8"?> <dispatch-entries> <dispatch> <url>www.custom-domain.com/</url> <module>default</module> </dispatch>
dispatch.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<dispatch-entries>
<dispatch>
<url>www.custom-domain.com/</url>
<module>default</module>
</dispatch>
</dispatch-entries>
我想配置http://www.custom-domain/admin/*
指向我的管理控制台
模块
http://www.custom-domain.com/admin/index.html
我知道模块已部署且工作正常,因为当我转到http://admin-console.myappid.appspot.com
它显示正确的index.html
页面
我尝试添加以下小节。
我找了又找,找不到这不起作用的原因
文档和示例中没有明确说明的我在这里遗漏了什么?我期望它会做什么:
这在管理控制台
模块日志中产生了以下错误
/admin/index.html No handlers matched this URL.
它实际上在做什么:
它实际做的是将www.custom-domain.com/admin/*
路由到管理控制台
模块的/admin/*
http://www.custom-domain.com/admin/index.html
我尝试添加一个目录并将我的index.html
移动到src/main/webapp/admin/index.html
。这也不起作用,它实际上是在寻找一个处理程序
我创建了一个Servlet
,并为/admin/*
添加了一个映射,它开始工作
如果要路由到非默认模块的根目录:
因此,如果要将某个内容映射到非默认模块的/
,则必须指定一个子域并将其映射到该模块
<dispatch>
<url>admin.custom-domain.com/*</url>
<module>admin-console</module>
</dispatch>
admin.custom-domain.com/*
管理控制台
这是我发现的在非默认模块的根上下文中访问任何内容的唯一方法
http://www.custom-domain.com/admin/index.html
/admin/index.html No handlers matched this URL.
<dispatch>
<url>admin.custom-domain.com/*</url>
<module>admin-console</module>
</dispatch>