I am trying to run a single page web application and map all URLs to index html. I have a non-rest controller which looks like this:
@RequestMapping(value = "/*")
public String getIndex()
{
return "index";
}
and this works fine. However, it does not match further forward slashes in the URL. Moreover, if I change the request mapping value from /*
to /**
, I start getting stack overflow exceptions: https://drive.google.com/file/d/0B83g4hczCyxgUDZDWTM5R1NLemM/view?usp=sharing.
Does anybody know how I can use @RequestMapping(value = "/**")
without getting stack overflow exceptions?
UPDATE
In jetty it gives the following error:
javax.servlet.ServletException: Circular view path [/WEB-INF/index.html]: would dispatch back to the current handler URL [/WEB-INF/index.html] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.).
The interesting thing about this message is that it knows that "index" refers to the file "/WEB-INF/index.html". Why can't it just render this view if it knows about it?
I have also found another stackoverflow.com question with the same problem. It was asked a year ago and still doesn't have an answer. Furthermore, this used to work in previous versions of Spring.