3
votes

I just started the spring 3 development and I had use spring 2.5 previously. I got stuck with the View Resolver. I had the following configuration

<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix" value="/WEB-INF/jsp/"/>
    <property name="suffix" value=".jsp"/>
</bean> 

And yes it works if the jsp pages is in the /WEB-INF/jsp path. The problem that I stumble is that if I had a jsp inside (e.g. /WEB-INF/jsp/prod/Monitor/success.jsp), I cannot get it to resolve the page if I type http://localhost/Project/prod/Monitor/success.html in the browser.

Did i miss anything here. Just for more info, the jsp will show up if the jsp had a controller, but I need it to resolve jsp pages with no controller associate with it.

2
Just add a simple controller for it.pap
If it doesn't need to pass through a controller, why is it a JSP? Change it to be a static HTML file and use @xueshi's answer about static resources.Thorn G

2 Answers

4
votes

Add this into context:

<mvc:view-controller path="/prod/Monitor/success.html" view-name="/prod/Monitor/success" />
0
votes

You can treat these pages as static resources . see this for details.