Spring 1.1.2 Release Miguel de Icaza ApacheCon Keynote
Nov 15

redirect: in Spring MVC

Tech Add comments

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>

2 Responses to “redirect: in Spring MVC”

  1. Sachin Danayak Says:

    I can have a implementation possible in Struts as
    —>
    action.getServlet().getServletContext().getRequestDispatcher(”/pages/ErrorPage.jsp”).forward(
    request,
    response);

    I want to work with same way in Spring also.

    Can anyone help me??????????

  2. Anonymous Says:

    asasa

Leave a Reply

Spam is a pain, I am sorry to have to do this to you, but can you answer the question below?

Q: Type in the word 'ajax'