craigmcc 2002/06/22 17:52:50 Modified: src/share/org/apache/struts/actions DispatchAction.java ForwardAction.java IncludeAction.java LookupDispatchAction.java Log: Upgrade the standard Action implementation classes to use Action.execute() instead of Action.perform(), which is deprecated in 1.1. PR: Bugzilla #8022 Submitted by: Chuck Cavaness <chuckcavaness at attbi.com> Revision Changes Path 1.6 +17 -20 jakarta-struts/src/share/org/apache/struts/actions/DispatchAction.java Index: DispatchAction.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/DispatchAction.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- DispatchAction.java 9 Mar 2002 22:26:35 -0000 1.5 +++ DispatchAction.java 23 Jun 2002 00:52:50 -0000 1.6 @@ -63,12 +63,10 @@ package org.apache.struts.actions; -import java.io.IOException; import java.io.PrintWriter; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; -import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; @@ -109,13 +107,13 @@ * <ul> * <li>public ActionForward delete(ActionMapping mapping, ActionForm form, * HttpServletRequest request, HttpServletResponse response) - * throws IOException, ServletException</li> + * throws Exception</li> * <li>public ActionForward insert(ActionMapping mapping, ActionForm form, * HttpServletRequest request, HttpServletResponse response) - * throws IOException, ServletException</li> + * throws Exception</li> * <li>public ActionForward update(ActionMapping mapping, ActionForm form, * HttpServletRequest request, HttpServletResponse response) - * throws IOException, ServletException</li> + * throws Exception</li> * </ul> * <p>and call one of the methods with a URL like this:</p> * <code> @@ -184,10 +182,10 @@ * @since 1.1 */ protected ActionForward dispatchMethod(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response, - String name) throws IOException { + ActionForm form, + HttpServletRequest request, + HttpServletResponse response, + String name) throws Exception { // Identify the method object to be dispatched to Method method = null; @@ -253,14 +251,13 @@ * @param request The HTTP request we are processing * @param response The HTTP response we are creating * - * @exception IOException if an input/output error occurs - * @exception ServletException if a servlet exception occurs + * @exception Exception if an exception occurs */ - public ActionForward perform(ActionMapping mapping, - ActionForm form, - HttpServletRequest request, - HttpServletResponse response) - throws IOException, ServletException { + public ActionForward execute(ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception { // Identify the request parameter containing the method name String parameter = mapping.getParameter(); 1.2 +7 -10 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.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ForwardAction.java 10 May 2001 03:13:32 -0000 1.1 +++ ForwardAction.java 23 Jun 2002 00:52:50 -0000 1.2 @@ -63,9 +63,7 @@ package org.apache.struts.actions; -import java.io.IOException; import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; @@ -131,14 +129,13 @@ * @param request The HTTP request we are processing * @param response The HTTP response we are creating * - * @exception IOException if an input/output error occurs - * @exception ServletException if a servlet exception occurs + * @exception Exception if an error occurs */ - public ActionForward perform(ActionMapping mapping, + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException { + throws Exception { // Create a RequestDispatcher the corresponding resource String path = mapping.getParameter(); 1.2 +7 -10 jakarta-struts/src/share/org/apache/struts/actions/IncludeAction.java Index: IncludeAction.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/IncludeAction.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- IncludeAction.java 10 May 2001 03:13:32 -0000 1.1 +++ IncludeAction.java 23 Jun 2002 00:52:50 -0000 1.2 @@ -63,9 +63,7 @@ package org.apache.struts.actions; -import java.io.IOException; import javax.servlet.RequestDispatcher; -import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; @@ -131,14 +129,13 @@ * @param request The HTTP request we are processing * @param response The HTTP response we are creating * - * @exception IOException if an input/output error occurs - * @exception ServletException if a servlet exception occurs + * @exception Exception if an error occurs */ - public ActionForward perform(ActionMapping mapping, + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException { + throws Exception { // Create a RequestDispatcher the corresponding resource String path = mapping.getParameter(); 1.3 +3 -7 jakarta-struts/src/share/org/apache/struts/actions/LookupDispatchAction.java Index: LookupDispatchAction.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/LookupDispatchAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- LookupDispatchAction.java 13 Jan 2002 00:25:36 -0000 1.2 +++ LookupDispatchAction.java 23 Jun 2002 00:52:50 -0000 1.3 @@ -56,7 +56,6 @@ */ package org.apache.struts.actions; -import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.util.HashMap; @@ -176,17 +175,14 @@ * request (if any) *@return Describes where and how control should be * forwarded. - *@exception IOException if an input/output error occurs - *@exception ServletException if a servlet exception occurs, mapping does - * not have a parameter attribute, or the request does not contain the - * attribute named in the mapping parameter. + *@exception Exception if an error occurs */ - public ActionForward perform( + public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) - throws IOException, ServletException { + throws Exception { // Identify the request parameter containing the method name String parameter = mapping.getParameter();
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>