tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manv...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host SaveAliasAction.java
Date Mon, 29 Apr 2002 19:31:48 GMT
manveen     02/04/29 12:31:48

  Modified:    webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host
                        SaveAliasAction.java
  Log:
  Added a check to validate if the alias name already exists.
  
  Revision  Changes    Path
  1.2       +16 -6     jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host/SaveAliasAction.java
  
  Index: SaveAliasAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host/SaveAliasAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SaveAliasAction.java	16 Apr 2002 18:54:46 -0000	1.1
  +++ SaveAliasAction.java	29 Apr 2002 19:31:48 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host/SaveAliasAction.java,v
1.1 2002/04/16 18:54:46 manveen Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/04/16 18:54:46 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/host/SaveAliasAction.java,v
1.2 2002/04/29 19:31:48 manveen Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/04/29 19:31:48 $
    *
    * ====================================================================
    *
  @@ -61,10 +61,10 @@
   
   package org.apache.webapp.admin.host;
   
  -
   import java.net.URLEncoder;
   import java.util.Iterator;
   import java.util.Locale;
  +import java.util.List;
   import java.io.IOException;
   import javax.management.Attribute;
   import javax.management.MBeanServer;
  @@ -97,7 +97,7 @@
    * <em>Edit Alias</em> transactions.
    *
    * @author Manveen Kaur
  - * @version $Revision: 1.1 $ $Date: 2002/04/16 18:54:46 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/29 19:31:48 $
    */
   
   public final class SaveAliasAction extends Action {
  @@ -174,7 +174,17 @@
           values[0] = aform.getAliasName();
   
           String hostName = aform.getHostName();
  -            
  +
  +        // validate if this alias already exists.
  +        List aliasVals = aform.getAliasVals();
  +        if (aliasVals.contains(values[0])) {
  +           ActionErrors errors = new ActionErrors();
  +            errors.add("aliasName",
  +                       new ActionError("error.aliasName.exists"));
  +            saveErrors(request, errors);
  +            return (new ActionForward(mapping.getInput()));
  +        }
  +        
           try {
               
               ObjectName hname = new ObjectName(hostName);
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message