I am working on a client/server application built using Angular/Spring respectively and recently changed the contextPath of the server (i.e. server.contextPath=/foo). The client and the server are packaged together into a jar and the client is then served at /. However, after changing the context path of the server the files of the client cannot be found - the index.html is properly served, but it links all the assets as /asset.js and since they are actually at /foo/asset.js they cannot be found. I tried solving this by adding resource handlers but it was to no avail. The code I used is something like:
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
super.addResourceHandlers(registry);
registry.addResourceHandler("/**").addResourceLocations("/foo/");
}
I tried other variations but it didn't help either. Any ideas?
Aucun commentaire:
Enregistrer un commentaire