ekbush 2002/10/16 08:17:23
Modified: src/share/org/apache/struts/actions ForwardAction.java
Log:
Change the behavior of ForwardAction from handling the request itself to
returning an ActionForward - allowing processActionForward to handle the
forward on it's behalf.
PR: 12309
Thanks to Jim Bonanno <[EMAIL PROTECTED]> for the patch!
Revision Changes Path
1.4 +7 -18
jakarta-struts/src/share/org/apache/struts/actions/ForwardAction.java
Index: ForwardAction.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/src/share/org/apache/struts/actions/ForwardAction.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ForwardAction.java 22 Sep 2002 05:58:46 -0000 1.3
+++ ForwardAction.java 16 Oct 2002 15:17:23 -0000 1.4
@@ -139,27 +139,16 @@
// Create a RequestDispatcher the corresponding resource
String path = mapping.getParameter();
+
if (path == null) {
response.sendError
(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
messages.getMessage("forward.path"));
return (null);
}
- RequestDispatcher rd =
- servlet.getServletContext().getRequestDispatcher(path);
- if (rd == null) {
- response.sendError
- (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
- messages.getMessage("forward.rd", path));
- return (null);
- }
-
- // Forward control to the specified resource
- rd.forward(request, response);
-
- // Tell the controller servlet that the response has been created
- return (null);
+ // Let the controller handle the request
+ return new ActionForward(path);
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>