Q:

HTTP Status 404 on jsp when using a multi-module build

I have foo.war running in Tomcat via Eclipse. I am using Spring Mvc. When I attempt to view the index page for this context:
http://localhost:8080/foo
I get: HTTP Status 404 - /foo/WEB-INF/pages/index.jsp
My Maven project has a src/main/webapp/WEB-INF/jsp/pages/index.jsp.
For some reason, this has to be in the .war maven module; it cannot be in a separate jar module included in the war as a dependency in maven. Which is strange, as Tomcat is picking up my servlet config in this separate maven module.
The view in Spring Mvc is configured in the following way:
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
        resolver.setPrefix("/WEB-INF/pages/");
        resolver.setSuffix(".jsp");
        resolver.setViewClass(JstlView.class);

My controller is like this:
@RequestMapping("/")
public String index(Map<String, Object> model) throws Exception {
    return "index";
}

The servlet mapping is currently "/".
How can I put the jsp in a separate module?
EDIT: Rewritten because a separate problem confused matters
EDIT: Changed some more. Looks like Maven multi-module build is involved...

A:

OK,
So it was putting the jsp in a separate jar that did it.
I should have used:
META-INF/resources
not
WEB-INF
See also: Can I serve JSPs from inside a JAR in lib, or is there a workaround?
Note that it is probably easier just to not use jsp, which must go back to the servlet container from Spring. Instead Velocity/Freemarker/Thymeleaf templates can be managed entirely with Spring. It is also convenient to put the templates in src/main/resources, rather than in these ugly META-INF/WEB-INF folders.

