I am trying to set the html5Mode of the UI Router provider to true for my Angular application: locationProvider.html5Mode(true) . Although this works on the client side (redirects accordingly), I run into problems on the server side. I am running an instance of Java Enterprise Edition on the Google App Engine.
I configured my web.xml as described in the Java EE section of the Angular ui-router FAQ :
<?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> </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>
Unfortunately, even with the above configuration, when I look at client-based routes, I still get a 404 error from the server. I tried different values ( /index.html , index.html ) for the error-page > location element with the same result.
I probably have something unclear in my configuration, but I don't understand what I'm doing wrong.
java-ee angularjs google-app-engine angular-ui-router
ahsteele
source share