user825282
user825282

Reputation: 61

Spring MVC, Return ModelAndView statements are ignored in Controller

I have following app setup.


 <bean id="jspViewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"
      p:prefix="/WEB-INF/jsp/"
      p:suffix=".jsp" 
      p:order="1"/>


<a href="doSuccess.htm">Click me</a>

Now, when I click on the Click me, I get a 404. I did a bit of debugging and realized that the method in the controller was indeed being called but irrespective of the return statement it is trying to find doSuccess.htm.

Upvotes: 2

Views: 970

Answers (1)

user825282
user825282

Reputation: 61

I figured the error. I was using Netbeans and i used the auto complete imports. It was importing the org.springframework.web.portlet.ModelAndView instead of servlet.ModelAndView.

Upvotes: 4

Related Questions