How to configure Java EE on GAE to work with Angular UI Router in html5Mode?

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

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.

+8
java-ee angularjs google-app-engine angular-ui-router
source share

No one has answered this question yet.

See similar questions:

0
How to rewrite a URL using the Google app engine - HTML5 mode doesn't work

or similar:

1690
How does data binding work in AngularJS?
1006
What is the difference between angular -route and angular -ui-router?
357
angular ui-router login authentication
2
Angular JS ui-router html5mode does not work on reboot
2
IIS configuration to use html5Mode angular ui routing
2
Express routing: how to return 404 error to a static file and support HTML5Mode for angular ui-router
one
Spring boot + OCPSoft urlRewriter + angular ui router html5mode
one
Why does angular ui-router reload the page even when reloadOnSearch is wrong in html5Mode?
0
JS 4 express and html5Mode redirection not working
0
ExpressJS with html5mode does not work when starting the API

All Articles