This post originated from an RSS feed registered with Java Buzz
by dion.
Original Post: redirect: in Spring MVC
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
With the new Spring 1.1.2 release, I can move an app away from CVS HEAD (I know. bad boy).
I was using the new redirect: notion in Spring MVC where I was able to change:
Get rid of the new RedirectView() so the Controller doesn't even know that I am doing a redirect
return new ModelAndView(getSuccessView(), "id", foo.getId());
Use the new redirect: syntax in my action-servlet.xml
<property name="successView"><value>redirect:/listAuctions.html</value></property>
Set the redirectContextRelative attribute to true in my Velocty View Resolved (this is true by default)
<bean id="viewResolver"
class="org.springframework.web.servlet.view.velocity.VelocityViewResolver">
<property name="exposeSpringMacroHelpers"><value>true</value></property>
<property name="requestContextAttribute"><value>rc</value></property>
<property name="redirectContextRelative"><value>true</value></property>
<property name="cache"><value>true</value></property>
<property name="prefix"><value>/WEB-INF/velocity/</value></property>
<property name="suffix"><value>.vm</value></property>
</bean>