Announcement Announcement Module
Collapse
No announcement yet.
How to forward to another controller from AbstractController Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to forward to another controller from AbstractController

    Hi

    I am trying to forward from one controller to another controller using "forward:", but no luck. Please somebody help me and here are my config and source.

    Code:
    public class UserController extends AbstractController{
    		
    	@Override
    	protected ModelAndView handleRequestInternal(HttpServletRequest request,
    			HttpServletResponse response) throws Exception {
    		
    		ModelAndView mav 
    		
    		// Some logic goes here
    		mav = new ModelAndView("forward:/list.htm");
    		return mav;
    	}
    }
    Code:
    <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <props>
                <prop key="/user.htm">userController</prop>
                <prop key="/list.htm">listController</prop>
            </props>
        </property>
    </bean>
    
    
    <bean id="userController" class="com.myapp.spring.web.UserController"/>
    <bean id="listController" class="com.myapp.spring.web.ListController"/>
Working...
X