DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12309>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12309

ForwardAction should return an ActionForward.

           Summary: ForwardAction should return an ActionForward.
           Product: Struts
           Version: 1.1 Beta 2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Standard Actions
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Struts 1.1 has added the RequestProcessor that allows customizing the behavior 
of a Struts application by overriding the appropriate process methods. The 
Struts action ForwardAction is by-passing this customization by directly 
calling the request dispatcher. A RequestProcessor subclass that overrides the 
doForward method, for example, will not be called as expected when the 
ForwardAction action is used.

Here is a suggested implementation for the ForwardAction excute method

    public ActionForward execute(ActionMapping mapping,
                                 ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
    throws Exception {

        String path = mapping.getParameter();
        if (path == null) {
            response.sendError
            (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
             messages.getMessage("forward.path"));
            return(null);
        }
        
        return new ActionForward( path );
}

The returned ActionForward will be processed in the processActionForward, which 
will forward to the path using the RequestDispatcher. The appropriate 
RequestProcessor overrides will also get called.

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to