You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by cr...@locus.apache.org on 2000/06/20 18:34:19 UTC

cvs commit: jakarta-struts/web/example/WEB-INF action.xml app.tld

craigmcc    00/06/20 09:34:17

  Modified:    src/example/org/apache/struts/example CheckLogonTag.java
                        Constants.java EditRegistrationAction.java
                        EditSubscriptionAction.java LogonAction.java
                        RegistrationForm.java SaveRegistrationAction.java
                        SaveSubscriptionAction.java SubscriptionForm.java
               src/share/org/apache/struts/action ActionBase.java
                        ActionMapping.java ActionMappingBase.java
                        ActionServlet.java
               web/documentation users_guide.html
               web/example/WEB-INF action.xml app.tld
  Added:       src/share/org/apache/struts/util ErrorMessages.java
  Log:
  Implement global and local forwarding lookups, including accepting global
  forwarding definitions in the action.xml file.
  
  Add David Geary's suggested ErrorMessages class with a couple of tweaks,
  and utilize it in the example application.
  
  Bring the user's guide documentation up to date with respect to action
  forwarding and validating action forms.
  
  NOT YET DONE:  The new "cancel" tag and associated functionality.
  
  Revision  Changes    Path
  1.2       +38 -4     jakarta-struts/src/example/org/apache/struts/example/CheckLogonTag.java
  
  Index: CheckLogonTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/CheckLogonTag.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CheckLogonTag.java	2000/05/31 22:28:14	1.1
  +++ CheckLogonTag.java	2000/06/20 16:33:45	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/CheckLogonTag.java,v 1.1 2000/05/31 22:28:14 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/05/31 22:28:14 $
  + * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/CheckLogonTag.java,v 1.2 2000/06/20 16:33:45 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/06/20 16:33:45 $
    *
    * ====================================================================
    *
  @@ -79,12 +79,46 @@
    * such user, forward control to the logon page.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2000/05/31 22:28:14 $
  + * @version $Revision: 1.2 $ $Date: 2000/06/20 16:33:45 $
    */
   
   public final class CheckLogonTag extends TagSupport {
   
   
  +    // --------------------------------------------------- Instance Variables
  +
  +
  +    /**
  +     * The page to which we should forward for the user to log on.
  +     */
  +    private String page = "/logon.jsp";
  +
  +
  +    // ----------------------------------------------------------- Properties
  +
  +
  +    /**
  +     * Return the forward page.
  +     */
  +    public String getPage() {
  +
  +	return (this.page);
  +
  +    }
  +
  +
  +    /**
  +     * Set the forward page.
  +     *
  +     * @param page The new forward page
  +     */
  +    public void setPage(String page) {
  +
  +	this.page = page;
  +
  +    }
  +
  +
       // ------------------------------------------------------- Public Methods
   
   
  @@ -107,7 +141,7 @@
   	    return (EVAL_BODY_INCLUDE);
   	else {
   	    try {
  -		pageContext.forward(Constants.LOGON_PAGE);
  +		pageContext.forward(page);
   	    } catch (Exception e) {
   		throw new JspException(e.toString());
   	    }
  
  
  
  1.2       +3 -9      jakarta-struts/src/example/org/apache/struts/example/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/Constants.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Constants.java	2000/05/31 22:28:14	1.1
  +++ Constants.java	2000/06/20 16:33:45	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/Constants.java,v 1.1 2000/05/31 22:28:14 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2000/05/31 22:28:14 $
  + * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/Constants.java,v 1.2 2000/06/20 16:33:45 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2000/06/20 16:33:45 $
    *
    * ====================================================================
    *
  @@ -67,7 +67,7 @@
    * Manifest constants for the example application.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2000/05/31 22:28:14 $
  + * @version $Revision: 1.2 $ $Date: 2000/06/20 16:33:45 $
    */
   
   public final class Constants {
  @@ -84,12 +84,6 @@
        * Users is stored.
        */
       public static final String DATABASE_KEY = "database";
  -
  -
  -    /**
  -     * The context-relative URI of the logon page for this application.
  -     */
  -    public static final String LOGON_PAGE = "/logon.jsp";
   
   
       /**
  
  
  
  1.4       +5 -5      jakarta-struts/src/example/org/apache/struts/example/EditRegistrationAction.java
  
  Index: EditRegistrationAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/EditRegistrationAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EditRegistrationAction.java	2000/06/16 07:12:16	1.3
  +++ EditRegistrationAction.java	2000/06/20 16:33:46	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/EditRegistrationAction.java,v 1.3 2000/06/16 07:12:16 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/06/16 07:12:16 $
  + * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/EditRegistrationAction.java,v 1.4 2000/06/20 16:33:46 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/06/20 16:33:46 $
    *
    * ====================================================================
    *
  @@ -85,7 +85,7 @@
    * User (if any).
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/06/16 07:12:16 $
  + * @version $Revision: 1.4 $ $Date: 2000/06/20 16:33:46 $
    */
   
   public final class EditRegistrationAction extends ActionBase {
  @@ -133,7 +133,7 @@
   		if (servlet.getDebug() >= 1)
   		    servlet.log("EditRegistrationAction: User is not logged on in session "
   	                        + session.getId());
  -		return (mapping.findForward("logon"));
  +		return (servlet.findForward("logon"));
   	    }
   	}
   
  
  
  
  1.4       +5 -5      jakarta-struts/src/example/org/apache/struts/example/EditSubscriptionAction.java
  
  Index: EditSubscriptionAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/EditSubscriptionAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EditSubscriptionAction.java	2000/06/16 07:12:16	1.3
  +++ EditSubscriptionAction.java	2000/06/20 16:33:47	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/EditSubscriptionAction.java,v 1.3 2000/06/16 07:12:16 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/06/16 07:12:16 $
  + * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/EditSubscriptionAction.java,v 1.4 2000/06/20 16:33:47 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/06/20 16:33:47 $
    *
    * ====================================================================
    *
  @@ -84,7 +84,7 @@
    * <code>SubscriptionForm</code> from the currently specified subscription.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/06/16 07:12:16 $
  + * @version $Revision: 1.4 $ $Date: 2000/06/20 16:33:47 $
    */
   
   public final class EditSubscriptionAction extends ActionBase {
  @@ -131,7 +131,7 @@
   	    if (servlet.getDebug() >= 1)
   	        servlet.log("EditSubscriptionAction: User is not logged on in session "
   	                    + session.getId());
  -	    return (mapping.findForward("logon"));
  +	    return (servlet.findForward("logon"));
   	}
   
   	// Identify the relevant subscription
  
  
  
  1.5       +9 -9      jakarta-struts/src/example/org/apache/struts/example/LogonAction.java
  
  Index: LogonAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/LogonAction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- LogonAction.java	2000/06/16 07:12:16	1.4
  +++ LogonAction.java	2000/06/20 16:33:48	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/LogonAction.java,v 1.4 2000/06/16 07:12:16 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/06/16 07:12:16 $
  + * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/LogonAction.java,v 1.5 2000/06/20 16:33:48 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/06/20 16:33:48 $
    *
    * ====================================================================
    *
  @@ -66,7 +66,6 @@
   import java.io.IOException;
   import java.util.Hashtable;
   import java.util.Locale;
  -import java.util.Vector;
   import javax.servlet.RequestDispatcher;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
  @@ -77,6 +76,7 @@
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
   import org.apache.struts.action.ActionServlet;
  +import org.apache.struts.util.ErrorMessages;
   import org.apache.struts.util.MessageResources;
   
   
  @@ -84,7 +84,7 @@
    * Implementation of <strong>Action</strong> that validates a user logon.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/06/16 07:12:16 $
  + * @version $Revision: 1.5 $ $Date: 2000/06/20 16:33:48 $
    */
   
   public final class LogonAction extends ActionBase {
  @@ -122,23 +122,23 @@
   	User user = null;
   
   	// Validate the request parameters specified by the user
  -	Vector errors = new Vector();
  +	ErrorMessages errors = new ErrorMessages();
   	String username = ((LogonForm) form).getUsername();
   	String password = ((LogonForm) form).getPassword();
   	Hashtable database = (Hashtable)
   	  servlet.getServletContext().getAttribute(Constants.DATABASE_KEY);
   	if (database == null)
  -	    errors.addElement("error.database.missing");
  +	    errors.addError("error.database.missing");
   	else {
   	    user = (User) database.get(username);
   	    if ((user != null) && !user.getPassword().equals(password))
   		user = null;
   	    if (user == null)
  -		errors.addElement("error.password.mismatch");
  +		errors.addError("error.password.mismatch");
   	}
   
   	// Report any errors we have discovered back to the original form
  -	if (errors.size() > 0) {
  +	if (errors.getSize() > 0) {
   	    saveErrors(request, errors);
   	    return (new ActionForward(mapping.getInputForm()));
   	}
  
  
  
  1.3       +13 -18    jakarta-struts/src/example/org/apache/struts/example/RegistrationForm.java
  
  Index: RegistrationForm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/RegistrationForm.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RegistrationForm.java	2000/06/16 01:32:21	1.2
  +++ RegistrationForm.java	2000/06/20 16:33:48	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/RegistrationForm.java,v 1.2 2000/06/16 01:32:21 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/06/16 01:32:21 $
  + * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/RegistrationForm.java,v 1.3 2000/06/20 16:33:48 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/06/20 16:33:48 $
    *
    * ====================================================================
    *
  @@ -65,6 +65,7 @@
   
   import java.util.Vector;
   import org.apache.struts.action.ValidatingActionForm;
  +import org.apache.struts.util.ErrorMessages;
   
   
   /**
  @@ -88,7 +89,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2000/06/16 01:32:21 $
  + * @version $Revision: 1.3 $ $Date: 2000/06/20 16:33:48 $
    */
   
   public final class RegistrationForm implements ValidatingActionForm  {
  @@ -361,33 +362,27 @@
   	if ("Cancel".equals(submit))
   	    return (null);
   
  -        Vector errors = new Vector();
  +	ErrorMessages errors = new ErrorMessages();
   	if ((username == null) || (username.length() < 1))
  -	    errors.addElement("error.username.required");
  +	    errors.addError("error.username.required");
   	if (!password.equals(password))
  -	    errors.addElement("error.password.match");
  +	    errors.addError("error.password.match");
   	if ((fromAddress == null) || (fromAddress.length() < 1))
  -	    errors.addElement("error.fromAddress.required");
  +	    errors.addError("error.fromAddress.required");
   	else {
   	    int atSign = fromAddress.indexOf("@");
   	    if ((atSign < 1) || (atSign >= (fromAddress.length() - 1)))
  -		errors.addElement("error.fromAddress.format");
  +		errors.addError("error.fromAddress.format");
   	}
   	if ((fullName == null) || (fullName.length() < 1))
  -	    errors.addElement("error.fullName.required");
  +	    errors.addError("error.fullName.required");
   	if ((replyToAddress != null) && (replyToAddress.length() > 0)) {
   	    int atSign = replyToAddress.indexOf("@");
   	    if ((atSign < 1) || (atSign >= (replyToAddress.length() - 1)))
  -		errors.addElement("error.replyToAddress.format");
  +		errors.addError("error.replyToAddress.format");
   	}
   
  -        String[] results = null;
  -        if (errors.size() > 0) {
  -            results = new String[errors.size()];
  -            for (int i = 0; i < results.length; i++)
  -                results[i] = (String) errors.elementAt(i);
  -        }
  -        return results;
  +	return (errors.getErrors());
   
       }
   
  
  
  
  1.5       +11 -11    jakarta-struts/src/example/org/apache/struts/example/SaveRegistrationAction.java
  
  Index: SaveRegistrationAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/SaveRegistrationAction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SaveRegistrationAction.java	2000/06/16 07:12:16	1.4
  +++ SaveRegistrationAction.java	2000/06/20 16:33:49	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/SaveRegistrationAction.java,v 1.4 2000/06/16 07:12:16 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/06/16 07:12:16 $
  + * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/SaveRegistrationAction.java,v 1.5 2000/06/20 16:33:49 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/06/20 16:33:49 $
    *
    * ====================================================================
    *
  @@ -66,7 +66,6 @@
   import java.io.IOException;
   import java.util.Locale;
   import java.util.Hashtable;
  -import java.util.Vector;
   import javax.servlet.RequestDispatcher;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
  @@ -77,6 +76,7 @@
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
   import org.apache.struts.action.ActionServlet;
  +import org.apache.struts.util.ErrorMessages;
   import org.apache.struts.util.MessageResources;
   
   
  @@ -86,7 +86,7 @@
    * created, the user is also implicitly logged on.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/06/16 07:12:16 $
  + * @version $Revision: 1.5 $ $Date: 2000/06/20 16:33:49 $
    */
   
   public final class SaveRegistrationAction extends ActionBase {
  @@ -132,7 +132,7 @@
   	// Is there a currently logged on user (unless creating)?
   	User user = (User) session.getAttribute(Constants.USER_KEY);
   	if (!"Create".equals(action) && (user == null))
  -	    return (mapping.findForward("logon"));
  +	    return (servlet.findForward("logon"));
   
   	// Was this transaction cancelled?
   	String submit = request.getParameter("submit");
  @@ -152,22 +152,22 @@
   
   	// Validate the request parameters specified by the user
   	String value = null;
  -	Vector errors = new Vector();
  +	ErrorMessages errors = new ErrorMessages();
   	value = regform.getUsername();
   	if (("Create".equals(action)) &&
   	    (database.get(value) != null))
  -	    errors.addElement("error.username.unique");
  +	    errors.addError("error.username.unique");
   	if ("Create".equals(action)) {
   	    value = regform.getPassword();
   	    if ((value == null) || (value.length() <1))
  -		errors.addElement("error.password.required");
  +		errors.addError("error.password.required");
   	    value = regform.getPassword2();
   	    if ((value == null) || (value.length() < 1))
  -		errors.addElement("error.password2.required");
  +		errors.addError("error.password2.required");
   	}
   
   	// Report any errors we have discovered back to the original form
  -	if (errors.size() > 0) {
  +	if (errors.getSize() > 0) {
   	    saveErrors(request, errors);
   	    return (new ActionForward(mapping.getInputForm()));
   	}
  
  
  
  1.5       +6 -6      jakarta-struts/src/example/org/apache/struts/example/SaveSubscriptionAction.java
  
  Index: SaveSubscriptionAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/SaveSubscriptionAction.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- SaveSubscriptionAction.java	2000/06/16 07:12:16	1.4
  +++ SaveSubscriptionAction.java	2000/06/20 16:33:51	1.5
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/SaveSubscriptionAction.java,v 1.4 2000/06/16 07:12:16 craigmcc Exp $
  - * $Revision: 1.4 $
  - * $Date: 2000/06/16 07:12:16 $
  + * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/SaveSubscriptionAction.java,v 1.5 2000/06/20 16:33:51 craigmcc Exp $
  + * $Revision: 1.5 $
  + * $Date: 2000/06/20 16:33:51 $
    *
    * ====================================================================
    *
  @@ -66,7 +66,6 @@
   import java.io.IOException;
   import java.util.Locale;
   import java.util.Hashtable;
  -import java.util.Vector;
   import javax.servlet.RequestDispatcher;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
  @@ -77,6 +76,7 @@
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
   import org.apache.struts.action.ActionServlet;
  +import org.apache.struts.util.ErrorMessages;
   import org.apache.struts.util.MessageResources;
   
   
  @@ -85,7 +85,7 @@
    * the mail subscription entered by the user.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.4 $ $Date: 2000/06/16 07:12:16 $
  + * @version $Revision: 1.5 $ $Date: 2000/06/20 16:33:51 $
    */
   
   public final class SaveSubscriptionAction extends ActionBase {
  @@ -129,7 +129,7 @@
   	// Is there a currently logged on user?
   	User user = (User) session.getAttribute(Constants.USER_KEY);
   	if (user == null)
  -	    return (mapping.findForward("logon"));
  +	    return (servlet.findForward("logon"));
   
   	// Is there a related Subscription object?
   	Subscription subscription =
  
  
  
  1.3       +12 -17    jakarta-struts/src/example/org/apache/struts/example/SubscriptionForm.java
  
  Index: SubscriptionForm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/SubscriptionForm.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SubscriptionForm.java	2000/06/16 01:32:22	1.2
  +++ SubscriptionForm.java	2000/06/20 16:33:52	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/SubscriptionForm.java,v 1.2 2000/06/16 01:32:22 craigmcc Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/06/16 01:32:22 $
  + * $Header: /home/cvs/jakarta-struts/src/example/org/apache/struts/example/SubscriptionForm.java,v 1.3 2000/06/20 16:33:52 craigmcc Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/06/20 16:33:52 $
    *
    * ====================================================================
    *
  @@ -65,6 +65,7 @@
   
   import java.util.Vector;
   import org.apache.struts.action.ValidatingActionForm;
  +import org.apache.struts.util.ErrorMessages;
   
   
   /**
  @@ -82,7 +83,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.2 $ $Date: 2000/06/16 01:32:22 $
  + * @version $Revision: 1.3 $ $Date: 2000/06/20 16:33:52 $
    */
   
   public final class SubscriptionForm implements ValidatingActionForm  {
  @@ -292,25 +293,19 @@
   	if ("Cancel".equals(submit))
   	    return (null);
   
  -        Vector errors = new Vector();
  +	ErrorMessages errors = new ErrorMessages();
   	if ((host == null) || (host.length() < 1))
  -	    errors.addElement("error.host.required");
  +	    errors.addError("error.host.required");
   	if ((username == null) || (username.length() < 1))
  -	    errors.addElement("error.username.required");
  +	    errors.addError("error.username.required");
   	if ((password == null) || (password.length() < 1))
  -	    errors.addElement("error.password.required");
  +	    errors.addError("error.password.required");
   	if ((type == null) || (type.length() < 1))
  -	    errors.addElement("error.type.required");
  +	    errors.addError("error.type.required");
   	else if (!"imap".equals(type) && !"pop3".equals(type))
  -	    errors.addElement("error.type.invalid");
  +	    errors.addError("error.type.invalid");
   
  -        String[] results = null;
  -        if (errors.size() > 0) {
  -            results = new String[errors.size()];
  -            for (int i = 0; i < results.length; i++)
  -                results[i] = (String) errors.elementAt(i);
  -        }
  -        return results;
  +	return (errors.getErrors());
   
       }
   
  
  
  
  1.4       +10 -12    jakarta-struts/src/share/org/apache/struts/action/ActionBase.java
  
  Index: ActionBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionBase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ActionBase.java	2000/06/16 07:12:18	1.3
  +++ ActionBase.java	2000/06/20 16:34:04	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionBase.java,v 1.3 2000/06/16 07:12:18 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/06/16 07:12:18 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionBase.java,v 1.4 2000/06/20 16:34:04 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/06/20 16:34:04 $
    *
    * ====================================================================
    *
  @@ -65,11 +65,11 @@
   
   import java.io.IOException;
   import java.util.Locale;
  -import java.util.Vector;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.http.HttpSession;
  +import org.apache.struts.util.ErrorMessages;
   import org.apache.struts.util.MessageResources;
   
   
  @@ -78,7 +78,7 @@
    * useful utility methods for use by Action classes.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/06/16 07:12:18 $
  + * @version $Revision: 1.4 $ $Date: 2000/06/20 16:34:04 $
    */
   
   public abstract class ActionBase implements Action {
  @@ -161,19 +161,17 @@
        * @param messages Vector containing message keys for looking
        *  up errors in the application resources
        */
  -    protected void saveErrors(HttpServletRequest request, Vector messages) {
  +    protected void saveErrors(HttpServletRequest request,
  +			      ErrorMessages messages) {
   
   	// Remove any error messages attribute if none are required
  -	if ((messages == null) || (messages.size() == 0)) {
  +	if ((messages == null) || (messages.getSize() == 0)) {
   	    request.removeAttribute(ERROR_KEY);
   	    return;
   	}
   
  -	// Construct and save the error messages we need
  -	String results[] = new String[messages.size()];
  -	for (int i = 0; i < results.length; i++)
  -	    results[i] = (String) messages.elementAt(i);
  -	request.setAttribute(ERROR_KEY, results);
  +	// Save the error messages we need
  +	request.setAttribute(ERROR_KEY, messages.getErrors());
   
       }
   
  
  
  
  1.4       +12 -4     jakarta-struts/src/share/org/apache/struts/action/ActionMapping.java
  
  Index: ActionMapping.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMapping.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ActionMapping.java	2000/06/16 07:12:18	1.3
  +++ ActionMapping.java	2000/06/20 16:34:05	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMapping.java,v 1.3 2000/06/16 07:12:18 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/06/16 07:12:18 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMapping.java,v 1.4 2000/06/20 16:34:05 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/06/20 16:34:05 $
    *
    * ====================================================================
    *
  @@ -97,7 +97,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/06/16 07:12:18 $
  + * @version $Revision: 1.4 $ $Date: 2000/06/20 16:34:05 $
    */
   
   public interface ActionMapping {
  @@ -236,6 +236,14 @@
        * @param name Name of the forward entry to be returned
        */
       public ActionForward findForward(String name);
  +
  +
  +    /**
  +     * Remove a <code>ActionForward</code> associated with this mapping.
  +     *
  +     * @param forward The ActionForward to be removed
  +     */
  +    public void removeForward(ActionForward forward);
   
   
   }
  
  
  
  1.4       +16 -4     jakarta-struts/src/share/org/apache/struts/action/ActionMappingBase.java
  
  Index: ActionMappingBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMappingBase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ActionMappingBase.java	2000/06/16 07:12:18	1.3
  +++ ActionMappingBase.java	2000/06/20 16:34:05	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMappingBase.java,v 1.3 2000/06/16 07:12:18 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2000/06/16 07:12:18 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionMappingBase.java,v 1.4 2000/06/20 16:34:05 craigmcc Exp $
  + * $Revision: 1.4 $
  + * $Date: 2000/06/20 16:34:05 $
    *
    * ====================================================================
    *
  @@ -72,7 +72,7 @@
    * subclassing this class and adding new "getter" and "setter" methods.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.3 $ $Date: 2000/06/16 07:12:18 $
  + * @version $Revision: 1.4 $ $Date: 2000/06/20 16:34:05 $
    */
   
   public class ActionMappingBase implements ActionMapping {
  @@ -370,6 +370,18 @@
       public ActionForward findForward(String name) {
   
   	return ((ActionForward) forwards.get(name));
  +
  +    }
  +
  +
  +    /**
  +     * Remove a <code>ActionForward</code> associated with this mapping.
  +     *
  +     * @param forward The ActionForward to be removed
  +     */
  +    public void removeForward(ActionForward forward) {
  +
  +	forwards.remove(forward.getName());
   
       }
   
  
  
  
  1.9       +55 -7     jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java
  
  Index: ActionServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ActionServlet.java	2000/06/16 07:12:18	1.8
  +++ ActionServlet.java	2000/06/20 16:34:07	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v 1.8 2000/06/16 07:12:18 craigmcc Exp $
  - * $Revision: 1.8 $
  - * $Date: 2000/06/16 07:12:18 $
  + * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v 1.9 2000/06/20 16:34:07 craigmcc Exp $
  + * $Revision: 1.9 $
  + * $Date: 2000/06/20 16:34:07 $
    *
    * ====================================================================
    *
  @@ -153,7 +153,7 @@
    * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.8 $ $Date: 2000/06/16 07:12:18 $
  + * @version $Revision: 1.9 $ $Date: 2000/06/20 16:34:07 $
    */
   
   public class ActionServlet
  @@ -177,6 +177,13 @@
   
   
       /**
  +     * The global ActionForward collection for this controller, keyed
  +     * by logical name.
  +     */
  +    protected Hashtable forwards = new Hashtable();
  +
  +
  +    /**
        * The resources object for our internal resources.
        */
       protected MessageResources internal = null;
  @@ -314,6 +321,18 @@
   
   
       /**
  +     * Register a logical forwarding to the set configured for this servlet.
  +     *
  +     * @param forward The forwarding to be added
  +     */
  +    public void addForward(ActionForward forward) {
  +
  +	forwards.put(forward.getName(), forward);
  +
  +    }
  +
  +
  +    /**
        * Register a mapping to the set configured for this servlet.
        *
        * @param mapping The mapping to be added
  @@ -326,12 +345,25 @@
   
   
       /**
  +     * Return the forwarding associated with the specified logical name,
  +     * if any; otherwise return <code>null</code>.
  +     *
  +     * @param name Logical name of the requested forwarding
  +     */
  +    public ActionForward findForward(String name) {
  +
  +	return ((ActionForward) forwards.get(name));
  +
  +    }
  +
  +
  +    /**
        * Return the mapping associated with the specified request path, if any;
        * otherwise return <code>null</code>.
        *
        * @param path Request path for which a mapping is requested
        */
  -    public ActionMapping getMapping(String path) {
  +    public ActionMapping findMapping(String path) {
   
   	return ((ActionMapping) mappings.get(path));
   
  @@ -339,6 +371,18 @@
   
   
       /**
  +     * Deregister a forwarding from the set configured for this servlet.
  +     *
  +     * @param forward The forwarding to be deregistered
  +     */
  +    public void removeForward(ActionForward forward) {
  +
  +	forwards.remove(forward.getName());
  +
  +    }
  +
  +
  +    /**
        * Deregister a mapping from the set configured for this servlet.
        *
        * @param mapping The mapping to be deregistered
  @@ -484,7 +528,11 @@
   	digester.addSetProperties("action-mappings/action/forward");
   	digester.addSetNext("action-mappings/action/forward", "addForward",
   			    "org.apache.struts.action.ActionForward");
  -
  +	digester.addObjectCreate("action-mappings/forward",
  +				 forwardClass);
  +	digester.addSetProperties("action-mappings/forward");
  +	digester.addSetNext("action-mappings/forward", "addForward",
  +			    "org.apache.struts.action.ActionForward");
   
   	// Parse the input stream to configure our mappings
   	try {
  @@ -647,7 +695,7 @@
        */
       protected ActionMapping processMapping(String path) {
   
  -	return (getMapping(path));
  +	return (findMapping(path));
   
       }
   
  
  
  
  1.1                  jakarta-struts/src/share/org/apache/struts/util/ErrorMessages.java
  
  Index: ErrorMessages.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/util/ErrorMessages.java,v 1.1 2000/06/20 16:34:10 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2000/06/20 16:34:10 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 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", "Tomcat", 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 apache@apache.org.
   *
   * 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.util;
  
  
  import java.util.Vector;
  
  
  /**
   * Utility class that is useful for accumulating error message keys in
   * action classes or validation methods.  Use this class as follows:
   * <ul>
   * <li>At the beginning of your action class or validation method,
   *     instantiate an instance of this class in a local variable.</li>
   * <li>Whenever you wish to add a new error message key, call the
   *     <code>addError()</code> method to add it.</li>
   * <li>To return the String array of error message keys required by
   *     other Struts components, call <code>getErrors()</code>.
   * </ul>
   *
   * @author David Geary
   * @revision $Revision: 1.1 $ $Date: 2000/06/20 16:34:10 $
   */
  
  public final class ErrorMessages {
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * The accumulated set of error message keys.
       */
      private Vector errors = new Vector();
  
  
      // --------------------------------------------------------- Public Methods
  
  
      /**
       * Add an error message key to the accumulated set of errors.
       *
       * @param key The error message key to be added
       */
      public void addError(String key) {
  
  	errors.addElement(key);
  
      }
  
  
      /**
       * Return the set of error message keys we have accumulated.
       */
      public String[] getErrors() {
  
  	if (errors.size() > 0) {
  	    String array[] = new String[errors.size()];
  	    for (int i = 0; i < array.length; i++)
  		array[i] = (String) errors.elementAt(i);
  	    return (array);
  	}
  	return (null);
  
      }
  
  
      /**
       * Return the number of error messages we have accumulated so far.
       */
      public int getSize() {
  
  	return (errors.size());
  
      }
  
  
  }
  
  
  
  1.5       +77 -33    jakarta-struts/web/documentation/users_guide.html
  
  Index: users_guide.html
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/web/documentation/users_guide.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- users_guide.html	2000/06/13 22:45:44	1.4
  +++ users_guide.html	2000/06/20 16:34:10	1.5
  @@ -6,7 +6,7 @@
   
   <div align="center">
   <h1>Struts User's Guide</h2>
  -<h3>$Id: users_guide.html,v 1.4 2000/06/13 22:45:44 craigmcc Exp $</h3>
  +<h3>$Id: users_guide.html,v 1.5 2000/06/20 16:34:10 craigmcc Exp $</h3>
   </div>
   
   
  @@ -114,18 +114,14 @@
   
   <p>Struts also supports the ability to use <code>ActionMapping</code>
   classes that have additional properties beyond the standard ones required
  -to operate the framework.  In many cases, this facility can be used to
  -declare the JSP page names of the appropriate "next" page, or pages, to
  -be displayed after the business logic represented by this <code>Action</code>
  -class is complete.  Using extended mappings in such a manner lets you
  -decouple the <i>Controller</i> logic (in the <code>Action</code> class)
  -from the <i>View</i> logic (in the JSP pages).  For example, most web
  -sites and web applications undergo periodic updates to their look and
  -feel (as well as changes in availble functionality).  Typically, such
  -redesigns cause the names of the relevant JSP pages to be changed.  If
  -you have defined the names of these pages only in the mappings, dealing
  -with such redesigns is substantially easier than if you had to go update
  -all of the <code>Action</code> classes individually.</p>
  +to operate the framework.  This allows you to store additional information
  +specific to your application, but still utilize the remaining features of
  +the framework.  In addition, Struts lets you define logical "names" to which
  +control should be forwarded so that an action method can ask for the
  +"Main Menu" page (for example), without knowing what the actual name of the
  +corresponding JSP page is.  These features greatly assist you in separating
  +the control logic (what do I do next) with the view logic (what is the name
  +of the corresponding page).</p>
   
   
   <h2>2. Building the Model Components</h2>
  @@ -659,6 +655,42 @@
   </ul>
   
   
  +<h4>3.3.4 Automatic Form Validation</h4>
  +
  +<p>In addition to the form and bean interactions described above, Struts
  +offers an additional facility if your bean knows how to validate the input
  +fields it has received.  To utilize this feature, have your bean class
  +implement the <code>ValidatingActionForm</code> interface, rather than the
  +<code>ActionForm</code> interface.  A ValidatingActionForm adds an additional
  +method signature:</p>
  +
  +<pre>
  +    public String[] validate()
  +</pre>
  +
  +<p>for a method that is called by the controller servlet after the bean
  +properties have been populated, but before the corresponding action class's
  +<code>perform()</code> method is invoked.  The <code>validate()</code> method
  +has the following options:</li>
  +<ul>
  +<li>Perform the appropriate validations and find no problems -- Return either
  +    <code>null</code> or a zero-length String array, and the controller servlet
  +    will proceed to call the <code>perform()</code> method of the appropriate
  +    <code>Action</code> class.
  +<li>Perform the appropriate validations and find problems -- Return a String
  +    array whose contents are the error message keys (into the application's
  +    <code>MessageResources</code> bundle) that should be displayed.  The
  +    controller servlet will store this array as a request attribute suitable
  +    for use by the <code>&lt;struts:errors&gt;</code> tag, and will forward
  +    control back to the input form (identified by the <code>inputForm</code>
  +    property for this <code>ActionMapping</code>.
  +</ul>
  +
  +<p>As mentioned earlier, this feature is entirely optional.  If your form bean
  +implements only the <code>ActionForm</code> interface, the controller servlet
  +will assume that any required validation is done by the action class.</p>
  +
  +
   <h3>3.4 Other Presentation Techniques</h3>
   
   <p>Although the look and feel of your application can be completely constructed
  @@ -784,18 +816,19 @@
   <p>The <code>Action</code> interface defines a single method that must be
   implemented by an <code>Action</code> class, as follows:</p>
   <pre>
  -    public void perform(ActionServlet servlet,
  -                        ActionMapping mapping,
  -                        ActionForm form,
  -                        HttpServletRequest request,
  -                        HttpServletResponse response)
  +    public ActionForward perform(ActionServlet servlet,
  +                                 ActionMapping mapping,
  +                                 ActionForm form,
  +                                 HttpServletRequest request,
  +                                 HttpServletResponse response)
         throws IOException, ServletException;
   </pre>
   
   <p>The goal of an <code>Action</code> class is to process this request,
  -and to forward control to the View component, such as a JSP page, that
  -will generate the corresponding response.  In the <i>Model 2</i> design
  -pattern, a typical <code>Action</code> class will implement the following
  +and then to return an <code>ActionForward</code> object that identifies
  +the JSP page (if any) to which control should be forwarded to generate
  +the corresponding response.  In the <i>Model 2</i> design pattern,
  +a typical <code>Action</code> class will implement the following
   logic in its <code>perform()</code> method:
   <ul>
   <li>Validate the current state of the user's session (for example, checking
  @@ -805,10 +838,12 @@
       logging on.  This could occur because a user tried to enter your
       application "in the middle" (say, from a bookmark), or because the
       session has timed out, and the servlet container created a new one.</li>
  -<li>Validate the request parameters included with this request.  If the
  -    <code>Action</code> class finds a problem, it stores appropriate error
  -    messages in a request scope bean, and forwards control back to the
  -    originating JSP page so that the errors can be corrected.</li>
  +<li>If validation has not yet occurred (due to the use of a form bean
  +    that implements the <code>ValidatingActionForm</code> interface),
  +    validate the form bean properties as necessary.  If a problem is found,
  +    store the appropriate error message keys as a request attribute, and
  +    forward control back to the input form so that the errors can be
  +    corrected.</li>
   <li>Perform the processing required to deal with this request (such as
       saving a row into a database).  This can be done by code embedded within
       the <code>Action</code> class itself, but should generally be performed
  @@ -816,9 +851,13 @@
   <li>Update the server-side objects that will be used to create the next
       page of the user interface (typically request scope or session scope
       beans, depending on how long you need to keep these items available).</li>
  -<li>Forward this request (using <code>RequestDispatcher.forward()</code>) to
  -    the appropriate JSP page to create the next page of the user interface,
  -    based on the newly updated beans.</li>
  +<li>Return an appropriate <code>ActionForward</code> object that identifies
  +    the JSP page to be used to generate this response, based on the newly
  +    updated beans.  Typically, you will acquire a reference to such an
  +    object by calling <code>findForward()</code> on either the
  +    <code>ActionMapping</code> object you received (if you are using a
  +    logical name local to this mapping), or on the controller servlet
  +    itself (if you are using a logical name global to the application).</li>
   </ul>
   
   <p>Design issues to remember when coding <code>Action</code> classes
  @@ -956,9 +995,9 @@
          actionClass="org.apache.struts.example.LogonAction"
        formAttribute="logonForm"
            formClass="org.apache.struts.example.LogonForm"
  -           success="/mainMenu.jsp"
  -           failure="/logon.jsp"
  -    /&gt;
  +         inputForm="/logon.jsp"&gt;
  +      &lt;forward name="success" path="/mainMenu.jsp"/&gt;
  +    &lt;/action&gt;
   
     &lt;/action-mapping&gt;
   </pre>
  @@ -974,6 +1013,12 @@
   forward control to the main menu if successful, or back to the logon form
   if not successful (such as an invalid username or password).</p>
   
  +<p>This <code>action</code> element also defines a logical name "success",
  +which is used within the <code>LogonAction</code> class to identify the
  +page to be used when a user successfully logs on.  Using a logical name like
  +this allows the action class to be insulated from any changes in the page
  +names that might occur due to a site redesign.</p>
  +
   
   <h3>4.5 The Web Application Deployment Descriptor</h3>
   
  @@ -1014,8 +1059,7 @@
   
   <p>The initialization parameters supported by the controller servlet are
   described in the <a href="api/index.html">Javadocs</a> for the
  -<code>ActionServlet</code> class, under the description for the
  -<code>init()</code> method.</p>
  +<code>ActionServlet</code> class.</p>
   
   
   <h4>4.5.2 Configure the Action Servlet Mapping</h4>
  
  
  
  1.4       +3 -8      jakarta-struts/web/example/WEB-INF/action.xml
  
  Index: action.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/web/example/WEB-INF/action.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- action.xml	2000/06/16 07:12:19	1.3
  +++ action.xml	2000/06/20 16:34:14	1.4
  @@ -2,13 +2,14 @@
   
   <action-mappings>
   
  +  <!-- Global Forward Declarations -->
  +  <forward name="logon"        path="/logon.jsp"/>
  +
     <!-- Edit user registration -->
     <action    path="/editRegistration"
         actionClass="org.apache.struts.example.EditRegistrationAction"
       formAttribute="registrationForm"
           formClass="org.apache.struts.example.RegistrationForm">
  -    <forward name="failure"    path="/logon.jsp"/>
  -    <forward name="logon"      path="/logon.jsp"/>
       <forward name="success"    path="/registration.jsp"/>
     </action>
   
  @@ -18,15 +19,12 @@
       formAttribute="subscriptionForm"
           formClass="org.apache.struts.example.SubscriptionForm">
       <forward name="failure"    path="/mainMenu.jsp"/>
  -    <forward name="logon"      path="/logon.jsp"/>
       <forward name="success"    path="/subscription.jsp"/>
     </action>
   
     <!-- Process a user logoff -->
     <action    path="/logoff"
         actionClass="org.apache.struts.example.LogoffAction">
  -    <forward name="failure"    path="/index.jsp"/>
  -    <forward name="logon"      path="/logon.jsp"/>
       <forward name="success"    path="/index.jsp"/>
     </action>
   
  @@ -36,7 +34,6 @@
       formAttribute="logonForm"
           formClass="org.apache.struts.example.LogonForm"
           inputForm="/logon.jsp">
  -    <forward name="logon"      path="/logon.jsp"/>
       <forward name="success"    path="/mainMenu.jsp"/>
     </action>
   
  @@ -46,7 +43,6 @@
       formAttribute="registrationForm"
           formClass="org.apache.struts.example.RegistrationForm"
           inputForm="/registration.jsp">
  -    <forward name="logon"      path="/logon.jsp"/>
       <forward name="success"    path="/mainMenu.jsp"/>
     </action>
   
  @@ -56,7 +52,6 @@
       formAttribute="subscriptionForm"
           formClass="org.apache.struts.example.SubscriptionForm"
           inputForm="/subscription.jsp">
  -    <forward name="logon"      path="/logon.jsp"/>
       <forward name="success"    path="/editRegistration.do?action=Edit"/>
     </action>
   
  
  
  
  1.2       +7 -1      jakarta-struts/web/example/WEB-INF/app.tld
  
  Index: app.tld
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/web/example/WEB-INF/app.tld,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- app.tld	2000/05/31 22:28:10	1.1
  +++ app.tld	2000/06/20 16:34:14	1.2
  @@ -20,8 +20,14 @@
       <tagclass>org.apache.struts.example.CheckLogonTag</tagclass>
       <info>
         Validate that there is a currently logged on user.  If there is
  -      not, forward control to the logon page.
  +      not, forward control to the logon page.  If not overridden by the
  +      "page" attribute, forwarding will be to "/logon.jsp".
       </info>
  +    <attribute>
  +      <name>page</name>
  +      <required>false</required>
  +      <rtexprvalue>false</rtexprvalue>
  +    </attribute>
     </tag>