Spring MVC, Return ModelAndView statements are ignored in Controller -
i have following app setup.
- the dispatcher servlet matched
*.htm
url pattern. - controller has annotation
@requestmapping(value = "dosuccess")
- the method above annotation returns
new modelandview("success");
<bean id="jspviewresolver" class="org.springframework.web.servlet.view.internalresourceviewresolver" p:prefix="/web-inf/jsp/" p:suffix=".jsp" p:order="1"/>
- the index page has link
<a href="dosuccess.htm">click me</a>
- there file called
success.jsp
located in/web-inf/jsp/
now, when click on click me, 404. did bit of debugging , realized method in controller indeed being called irrespective of return statement trying find dosuccess.htm
.
i figured error. using netbeans , used auto complete imports. importing org.springframework.web.portlet.modelandview instead of servlet.modelandview.
Comments
Post a Comment