struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew O'Haire <MOha...@fm.optus.net.au>
Subject RE: Forward To Another Action
Date Tue, 02 Oct 2001 04:04:08 GMT
yes, it's very easy...

in your struts-config.xml put a <forward/> tag in your action map, thus:

    <action path="/myAction"
            type="com.matto.myAction"
            name="myForm"
            scope="request"
            input="/index.jsp">
	    <forward name="nextAction" path="/nextAction.do"/>
    </action>

in your Action code simply return the named forward mapping, thus:

  public ActionForward performAction(ActionMapping mapping,
                               ActionForm form,
                               HttpServletRequest request,
                               HttpServletResponse response)
  throws IOException, ServletException, 
  {
    // implement your action here....
    
    // Forward control to the specified success URI
    return (mapping.findForward("nextAction"));
  }



-----Original Message-----
From: Jeff Gutierrez [mailto:jeff@mapua.org]
Sent: Tuesday, October 02, 2001 11:27
To: Struts Mailing List
Subject: Forward To Another Action



Hey guys,

Quick question.. can an action forward to another action?  If so, how can 
I do it?

Thanks,

jeff --

-- 
Jeff Gutierrez
Mapua Online! 
http://www.mapua.org
http://www.mapua.com
http://www.mapua.net

Pinoy Ako! May reklamo?

Mime
View raw message