cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java
husted 2004/01/09 19:29:19 Modified:src/share/org/apache/struts/action ActionError.java src/share/org/apache/struts/actions SwitchAction.java Log: Javadoc updates only; no code changes. Revision ChangesPath 1.13 +5 -5 jakarta-struts/src/share/org/apache/struts/action/ActionError.java Index: ActionError.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionError.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- ActionError.java 19 Dec 2003 03:20:44 - 1.12 +++ ActionError.java 10 Jan 2004 03:29:19 - 1.13 @@ -80,7 +80,7 @@ * * @author Craig R. McClanahan * @version $Revision$ $Date$ - * @deprecated Please use codeActionMessage/code instead, deprecated in struts 1.2.1 + * @deprecated Please use codeActionMessage/code instead, deprecated since 1.2.0. */ public class ActionError extends ActionMessage implements Serializable { 1.13 +5 -17 jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java Index: SwitchAction.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- SwitchAction.java 5 Oct 2003 17:48:57 - 1.12 +++ SwitchAction.java 10 Jan 2004 03:29:19 - 1.13 @@ -119,19 +119,7 @@ // - Public Methods -/** - * Process the specified HTTP request, and create the corresponding HTTP - * response (or forward to another web component that will create it), - * with provision for handling exceptions thrown by the business logic. - * - * @param mapping The ActionMapping used to select this instance - * @param form The optional ActionForm bean for this request (if any) - * @param request The HTTP request we are processing - * @param response The HTTP response we are creating - * - * @exception Exception if the application business logic throws - * an exception - */ +// See superclass for JavaDoc public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java
dgraham 2003/08/02 14:21:32 Modified:src/share/org/apache/struts/actions SwitchAction.java Log: Replace RequestUtils calls with ModuleUtils. Revision ChangesPath 1.11 +6 -6 jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java Index: SwitchAction.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- SwitchAction.java 11 Jul 2003 23:47:57 - 1.10 +++ SwitchAction.java 2 Aug 2003 21:21:31 - 1.11 @@ -73,7 +73,7 @@ import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.util.MessageResources; -import org.apache.struts.util.RequestUtils; +import org.apache.struts.util.ModuleUtils; /** * pA standard strongAction/strong that switches to a new module @@ -148,7 +148,7 @@ } // Switch to the requested module -RequestUtils.selectModule(prefix, request, getServlet().getServletContext()); +ModuleUtils.getInstance().selectModule(prefix, request, getServlet().getServletContext()); if (request.getAttribute(Globals.MODULE_KEY) == null) { String message = messages.getMessage(switch.prefix, prefix); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java
rleland 2002/11/27 23:12:52 Modified:src/share/org/apache/struts/actions SwitchAction.java Log: Bug#: 14054 Change Docs to read module and not application module Revision ChangesPath 1.9 +8 -8 jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java Index: SwitchAction.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- SwitchAction.java 9 Nov 2002 16:30:02 - 1.8 +++ SwitchAction.java 28 Nov 2002 07:12:52 - 1.9 @@ -85,11 +85,11 @@ * listrongpage/strong - Module-relative URI (beginning with /) * to which control should be forwarded after switching./li * listrongprefix/strong - The module prefix (beginning with /) - * of the application module to which control should be switched. Use a + * of the module to which control should be switched. Use a * zero-length string for the default module. The - * appropriate codeApplicationConfig/code object will be stored as a + * appropriate codeModuleConfig/code object will be stored as a * request attribute, so any subsequent logic will assume the new - * application module./li + * module./li * /ul * * @author Craig R. McClanahan @@ -150,7 +150,7 @@ return (null); } -// Switch to the requested application module +// Switch to the requested module RequestUtils.selectModule(prefix, request, getServlet().getServletContext()); if (request.getAttribute(Globals.MODULE_KEY) == null) { -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java
husted 2002/07/09 16:57:17 Modified:src/share/org/apache/struts/actions SwitchAction.java Log: Javadoc updates. No code changes. Revision ChangesPath 1.5 +14 -14 jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java Index: SwitchAction.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SwitchAction.java 30 Jun 2002 03:38:30 - 1.4 +++ SwitchAction.java 9 Jul 2002 23:57:16 - 1.5 @@ -78,20 +78,20 @@ /** - * pA standard strongAction/strong that switches to a new sub-application - * and then forards control to a URI (specified in a number of possible ways) - * within the new sub-application./p + * pA standard strongAction/strong that switches to a new module + * and then forwards control to a URI (specified in a number of possible ways) + * within the new module./p * * pValid request parameters for this Action are:/p * ul - * listrongpage/strong - Application-relative URI (beginning with /) + * listrongpage/strong - Module-relative URI (beginning with /) * to which control should be forwarded after switching./li - * listrongprefix/strong - The application prefix (beginning with /) - * of the sub-application to which control should be switched. Use a - * zero-length string for the default sub-application. The + * listrongprefix/strong - The module prefix (beginning with /) + * of the application module to which control should be switched. Use a + * zero-length string for the default module. The * appropriate codeApplicationConfig/code object will be stored as a * request attribute, so any subsequent logic will assume the new - * sub-application./li + * application module./li * /ul * * @author Craig R. McClanahan @@ -152,7 +152,7 @@ return (null); } -// Switch to the requested sub-application +// Switch to the requested application module RequestUtils.selectApplication(prefix, request, getServlet().getServletContext()); if (request.getAttribute(Action.APPLICATION_KEY) == null) { @@ -163,7 +163,7 @@ return (null); } -// Forward control to the specified application-relative URI +// Forward control to the specified module-relative URI return (new ActionForward(page)); } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java LookupDispatchAction.java DispatchAction.java
husted 2002/06/25 11:26:15 Modified:src/share/org/apache/struts/actions SwitchAction.java LookupDispatchAction.java DispatchAction.java Log: JavaDoc updates for execute versus perform. Revision ChangesPath 1.3 +5 -5 jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java Index: SwitchAction.java === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- SwitchAction.java 23 Mar 2002 01:38:15 - 1.2 +++ SwitchAction.java 25 Jun 2002 18:26:15 - 1.3 @@ -96,7 +96,7 @@ * * @author Craig R. McClanahan * @version $Revision$ $Date$ - * @since 1.1 + * @since Struts 1.1 */ public class SwitchAction extends Action { 1.5 +1 -1 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.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- LookupDispatchAction.java 25 Jun 2002 01:30:40 - 1.4 +++ LookupDispatchAction.java 25 Jun 2002 18:26:15 - 1.5 @@ -76,7 +76,7 @@ * p * * An abstract strongAction/strong that dispatches to the subclass mapped - * perform method. This is useful in + * codeexecute/code method. This is useful in * cases where an HTML form has multiple submit buttons with the same name. The * button name is specified by the codeparameter/code property of the * corresponding ActionMapping. To configure the use of this action in your 1.7 +8 -8 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.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- DispatchAction.java 23 Jun 2002 00:52:50 - 1.6 +++ DispatchAction.java 25 Jun 2002 18:26:15 - 1.7 @@ -100,8 +100,8 @@ * /code * * pwhich will use the value of the request parameter named method - * to pick the appropriate perform method, which must have the same - * signature (other than method name) of the standard Action.perform() + * to pick the appropriate execute method, which must have the same + * signature (other than method name) of the standard Action.execute * method. For example, you might have the following three methods in the * same action:/p * ul @@ -179,7 +179,7 @@ /** * Dispatch to the specified method. * Added to class at Revision 1.3 - * @since 1.1 + * @since Struts 1.1 */ protected ActionForward dispatchMethod(ActionMapping mapping, ActionForm form, @@ -293,7 +293,7 @@ /** * Introspect the current class to identify a method of the specified - * name that accepts the same parameter types as the codeperform()/code + * name that accepts the same parameter types as the codeexecute/code * method does. * * @param name Name of the method to be introspected -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java LocalStrings.properties
Actually, my correction isn't quite right either. I believe the attributes being set/removed here should not have the prefix at all, since this action is (or rather should be) effectively doing the same thing as the second half of RequestUtils.selectApplication(). In fact, given that, would it make sense to encapsulate the attribute manipulation into a new RequestUtils.setApplication(), say, which could then be called by SwitchAction (and any other interested party)? I can make the changes, but I wanted to check with you, Craig, to make sure I'm not off on the wrong track somehow. -- Martin Cooper - Original Message - From: Martin Cooper [EMAIL PROTECTED] To: Struts Developers List [EMAIL PROTECTED] Sent: Wednesday, March 20, 2002 9:20 PM Subject: Re: cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java LocalStrings.properties The following (from near the end of the commit message) doesn't look right to me: if (resources != null) { request.setAttribute(Action.MESSAGES_KEY + prefix, resources); } else { request.removeAttribute(Action.MESSAGES_KEY + prefix); } Shouldn't the attribute that's being removed be the one with the *old* prefix, rather than the new prefix? That is, isn't this supposed to remove any existing bundle for the source module before proceeding to the target module, since the target module doesn't have default resources of its own? -- Martin Cooper - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 20, 2002 5:42 PM Subject: cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java LocalStrings.properties craigmcc02/03/20 17:42:42 Modified:src/share/org/apache/struts/actions LocalStrings.properties Added: src/share/org/apache/struts/actions SwitchAction.java Log: Add a standard action that makes it easy to switch between sub-applications (surprisingly hard to do with, because the selected ApplicationConfig and MessageResources are normally based solely on the original request URI). Now, assuming you have mapped this to path /switch, you can set up a hyperlink that goes to the /menu.do action of the sub-application at prefix /bar: html:link page=/switch.do?prefix=/baramp;page=/menu.do.../html:link Revision ChangesPath 1.3 +2 -1 jakarta-struts/src/share/org/apache/struts/actions/LocalStrings.properties Index: LocalStrings.properties === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/LocalStrings.pr operties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- LocalStrings.properties 10 May 2001 03:13:33 - 1.2 +++ LocalStrings.properties 21 Mar 2002 01:42:42 - 1.3 @@ -8,4 +8,5 @@ forward.rd=Cannot create request dispatcher for path {0} include.path=No context-relative URI specified via the 'parameter' attribute include.rd=Cannot create request dispatcher for path {0} - +switch.prefix=Invalid sub-application prefix {0} was specified +switch.required=Switch requires both 'prefix' and 'path' request parameters 1.1 jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java Index: SwitchAction.java === /* * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.ja va,v 1.1 2002/03/21 01:42:42 craigmcc Exp $ * $Revision: 1.1 $ * $Date: 2002/03/21 01:42:42 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names
cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java LocalStrings.properties
craigmcc02/03/20 17:42:42 Modified:src/share/org/apache/struts/actions LocalStrings.properties Added: src/share/org/apache/struts/actions SwitchAction.java Log: Add a standard action that makes it easy to switch between sub-applications (surprisingly hard to do with, because the selected ApplicationConfig and MessageResources are normally based solely on the original request URI). Now, assuming you have mapped this to path /switch, you can set up a hyperlink that goes to the /menu.do action of the sub-application at prefix /bar: html:link page=/switch.do?prefix=/baramp;page=/menu.do.../html:link Revision ChangesPath 1.3 +2 -1 jakarta-struts/src/share/org/apache/struts/actions/LocalStrings.properties Index: LocalStrings.properties === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/LocalStrings.properties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- LocalStrings.properties 10 May 2001 03:13:33 - 1.2 +++ LocalStrings.properties 21 Mar 2002 01:42:42 - 1.3 @@ -8,4 +8,5 @@ forward.rd=Cannot create request dispatcher for path {0} include.path=No context-relative URI specified via the 'parameter' attribute include.rd=Cannot create request dispatcher for path {0} - +switch.prefix=Invalid sub-application prefix {0} was specified +switch.required=Switch requires both 'prefix' and 'path' request parameters 1.1 jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java Index: SwitchAction.java === /* * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java,v 1.1 2002/03/21 01:42:42 craigmcc Exp $ * $Revision: 1.1 $ * $Date: 2002/03/21 01:42:42 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Struts, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation. For more * information on the Apache Software Foundation, please see * http://www.apache.org/. * */ package org.apache.struts.actions; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.logging.Log; import
Re: cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java LocalStrings.properties
The following (from near the end of the commit message) doesn't look right to me: if (resources != null) { request.setAttribute(Action.MESSAGES_KEY + prefix, resources); } else { request.removeAttribute(Action.MESSAGES_KEY + prefix); } Shouldn't the attribute that's being removed be the one with the *old* prefix, rather than the new prefix? That is, isn't this supposed to remove any existing bundle for the source module before proceeding to the target module, since the target module doesn't have default resources of its own? -- Martin Cooper - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, March 20, 2002 5:42 PM Subject: cvs commit: jakarta-struts/src/share/org/apache/struts/actions SwitchAction.java LocalStrings.properties craigmcc02/03/20 17:42:42 Modified:src/share/org/apache/struts/actions LocalStrings.properties Added: src/share/org/apache/struts/actions SwitchAction.java Log: Add a standard action that makes it easy to switch between sub-applications (surprisingly hard to do with, because the selected ApplicationConfig and MessageResources are normally based solely on the original request URI). Now, assuming you have mapped this to path /switch, you can set up a hyperlink that goes to the /menu.do action of the sub-application at prefix /bar: html:link page=/switch.do?prefix=/baramp;page=/menu.do.../html:link Revision ChangesPath 1.3 +2 -1 jakarta-struts/src/share/org/apache/struts/actions/LocalStrings.properties Index: LocalStrings.properties === RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/LocalStrings.pr operties,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- LocalStrings.properties 10 May 2001 03:13:33 - 1.2 +++ LocalStrings.properties 21 Mar 2002 01:42:42 - 1.3 @@ -8,4 +8,5 @@ forward.rd=Cannot create request dispatcher for path {0} include.path=No context-relative URI specified via the 'parameter' attribute include.rd=Cannot create request dispatcher for path {0} - +switch.prefix=Invalid sub-application prefix {0} was specified +switch.required=Switch requires both 'prefix' and 'path' request parameters 1.1 jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.java Index: SwitchAction.java === /* * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/actions/SwitchAction.ja va,v 1.1 2002/03/21 01:42:42 craigmcc Exp $ * $Revision: 1.1 $ * $Date: 2002/03/21 01:42:42 $ * * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2002 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation (http://www.apache.org/). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Struts, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS