vendredi 20 février 2015

spring mvc catch all route but only unknown routes

I've got a spring boot app with angular on the frontend.


I'm using ui-router with html5 mode and I would like spring to render the same index.html on all unknown routes.



// Works great, but it also overrides all the resources
@RequestMapping
public String index() {
return "index";
}

// Seems do be the same as above, but still overrides the resources
@RequestMapping("/**")
public String index() {
return "index";
}

// Works well but not for subdirectories. since it doesn't map to those
@RequestMapping("/*")
public String index() {
return "index";
}


So my question is how can i create a fallback mapping but that lets through the resources?


Aucun commentaire:

Enregistrer un commentaire