ahs*_*ele 11 google-app-engine java-ee angularjs angular-ui-router
我正在尝试将我的Angular应用程序的UI路由器位置提供程序html5Mode设置为true : locationProvider.html5Mode(true). 虽然这适用于客户端(适当重定向),但我遇到问题服务器端.我在Google App Engine上运行实例Java Enterprise Edition.
我已经按照Angular FAQweb.xml中的Java EE部分ui-router配置了我:
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
<error-page>
<error-code>404</error-code>
<location>/</location>
</error-page>
<servlet>
<servlet-name>SystemServiceServlet</servlet-name>
<servlet-class>com.google.api.server.spi.SystemServiceServlet</servlet-class>
<init-param>
<param-name>services</param-name>
<param-value>
<!-- stuff specific to my GAE app -->
</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>SystemServiceServlet</servlet-name>
<url-pattern>/_ah/spi/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
Run Code Online (Sandbox Code Playgroud)
遗憾的是,即使使用上述配置,当我浏览到基于客户端的路由时,我仍然从服务器收到404错误.我已经尝试了具有相同结果的元素的各种值(/index.html,index.html)error-page > location.
我可能在我的配置中遗漏了一些明显的东西,但我不知道我做错了什么.