Answer the question
In order to leave comments, you need to log in
How to properly configure ui-routing+Spring MVC?
Welcome all! When developing a resource, I ran into a problem with configuring routing. I use ui-routing on the client side. Everything is fine exactly until the moment you go to any part of the site not from the start page. That is, if you follow the link: mysite.com/catalog/unicorns , then the server will naturally give you only the nested view /catalog/unicorns, without pulling up either Js or css. How to build in this case the correct architecture so that it pumps out a full-fledged view? On the server side I use Spring MVC . I would also like to ask: if I return html, then was it the right decision not to set up the ViewResolver, but simply to specify the resources:
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**").addResourceLocations("/");
}
@RequestMapping(value = "/", method = RequestMethod.GET)
public String welcome() {
return "index.html";
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question