java - Use concrete viewResolver for concrete method -
for methods use standard viewresolver:
<beans:bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <beans:property name="prefix" value="/web-inf/views/" /> <beans:property name="suffix" value=".jsp" /> </beans:bean>
but method want use viewresolver(empty viewresolver).
how can make method ?
@requestmapping(value="/logout", method = requestmethod.get ) public string logout(model model) throws exception { model.addattribute("message", "success logout"); return "home.jsp";//i want forward webapp/home.jsp }
instead of forwarding use redirect , prefix returned view redirect:
@requestmapping(value="/logout", method = requestmethod.get ) public string logout(redirectattributes redirect) throws exception { redirect.addflashattribute("message", "success logout"); return "redirect:/home.jsp";//i want forward webapp/home.jsp }
something that. redirect/forward prefixes explained in the reference guide.
Comments
Post a Comment