You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2002/09/04 19:30:31 UTC
DO NOT REPLY [Bug 12309] New: -
ForwardAction should return an ActionForward.
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: struts-dev@jakarta.apache.org
ReportedBy: bonanno@us.ibm.com
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>