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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -