husted 2003/12/21 14:43:19 Modified: src/example/org/apache/struts/webapp/example SaveSubscriptionAction.java SaveRegistrationAction.java EditSubscriptionAction.java EditRegistrationAction.java Log: Use "name" rather than "attribute" in configuration, per documented and common practice. Revision Changes Path 1.16 +5 -19 jakarta-struts/src/example/org/apache/struts/webapp/example/SaveSubscriptionAction.java Index: SaveSubscriptionAction.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/SaveSubscriptionAction.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- SaveSubscriptionAction.java 4 Sep 2003 16:03:42 -0000 1.15 +++ SaveSubscriptionAction.java 21 Dec 2003 22:43:19 -0000 1.16 @@ -96,21 +96,7 @@ // --------------------------------------------------------- Public Methods - /** - * Process the specified HTTP request, and create the corresponding HTTP - * response (or forward to another web component that will create it). - * Return an <code>ActionForward</code> instance describing where and how - * control should be forwarded, or <code>null</code> if the response has - * already been completed. - * - * @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, 1.19 +5 -19 jakarta-struts/src/example/org/apache/struts/webapp/example/SaveRegistrationAction.java Index: SaveRegistrationAction.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/SaveRegistrationAction.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- SaveRegistrationAction.java 4 Sep 2003 16:03:42 -0000 1.18 +++ SaveRegistrationAction.java 21 Dec 2003 22:43:19 -0000 1.19 @@ -98,21 +98,7 @@ // --------------------------------------------------------- Public Methods - /** - * Process the specified HTTP request, and create the corresponding HTTP - * response (or forward to another web component that will create it). - * Return an <code>ActionForward</code> instance describing where and how - * control should be forwarded, or <code>null</code> if the response has - * already been completed. - * - * @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, 1.15 +5 -40 jakarta-struts/src/example/org/apache/struts/webapp/example/EditSubscriptionAction.java Index: EditSubscriptionAction.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/EditSubscriptionAction.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- EditSubscriptionAction.java 4 Sep 2003 16:03:42 -0000 1.14 +++ EditSubscriptionAction.java 21 Dec 2003 22:43:19 -0000 1.15 @@ -94,21 +94,7 @@ // --------------------------------------------------------- Public Methods - /** - * Process the specified HTTP request, and create the corresponding HTTP - * response (or forward to another web component that will create it). - * Return an <code>ActionForward</code> instance describing where and how - * control should be forwarded, or <code>null</code> if the response has - * already been completed. - * - * @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, @@ -157,27 +143,6 @@ session.setAttribute(Constants.SUBSCRIPTION_KEY, subscription); } - /* The body of the if block below should *never* be executed. - * Since this Action has a RegistrationForm attribute, struts has - * already created the form. The check below is just to guard against - * a null pointer exception in case someone inadvertently removes the - * attribute="registrationForm" from struts-config-registration.xml - */ - if (form == null) { - if (log.isTraceEnabled()) { - log.trace( - " Creating new SubscriptionForm bean under key " - + mapping.getAttribute()); - } - - form = new SubscriptionForm(); - if ("request".equals(mapping.getScope())) { - request.setAttribute(mapping.getAttribute(), form); - } else { - session.setAttribute(mapping.getAttribute(), form); - } - } - SubscriptionForm subform = (SubscriptionForm) form; subform.setAction(action); if (!action.equals("Create")) { 1.16 +5 -40 jakarta-struts/src/example/org/apache/struts/webapp/example/EditRegistrationAction.java Index: EditRegistrationAction.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/webapp/example/EditRegistrationAction.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- EditRegistrationAction.java 25 Oct 2003 01:37:11 -0000 1.15 +++ EditRegistrationAction.java 21 Dec 2003 22:43:19 -0000 1.16 @@ -95,21 +95,7 @@ // --------------------------------------------------------- Public Methods - /** - * Process the specified HTTP request, and create the corresponding HTTP - * response (or forward to another web component that will create it). - * Return an <code>ActionForward</code> instance describing where and how - * control should be forwarded, or <code>null</code> if the response has - * already been completed. - * - * @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, @@ -141,27 +127,6 @@ } } - /* The body of the if block below should *never* be executed. - * Since this Action has a RegistrationForm attribute, struts has - * already created the form. The check below is just to guard against - * a null pointer exception in case someone inadvertently removes the - * attribute="RegistrationForm" from struts-config-registration.xml - */ - if (form == null) { - if (log.isTraceEnabled()) { - log.trace( - " Creating new RegistrationForm bean under key " - + mapping.getAttribute()); - } - - form = new RegistrationForm(); - if ("request".equals(mapping.getScope())) { - request.setAttribute(mapping.getAttribute(), form); - } else { - session.setAttribute(mapping.getAttribute(), form); - } - } - RegistrationForm regform = (RegistrationForm) form; if (user != null) { if (log.isTraceEnabled()) {
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]