Allow spring View MVC from pathpath class

I have some JSP views packaged inside a jar that I have in the path of the Spring MVC class of a web application. How do I configure a view resolver in a Spring XML application file to resolve the view name to one of these class path resources?

+4
source share
1 answer

The structure of the JAR file may matter. & sect; 10.5 Java Servlet 3.0 Spec says:

... For example, for a web application with a path / directory in a web container, the index.html file in the Web application hierarchy database or in the JAR file inside WEB-INF / lib, which includes index.html in the META-INF / resources directory may have served to satisfy the request /catalog/index.html ...

Perhaps try running JSP this way. If it works, all you need is just a Spring InternalResourceViewResolver configured with the correct prefix / suffix.

+1
source

All Articles