Package org.apache.struts.action

Examples of org.apache.struts.action.ActionError


       
        // front end validation when save is clicked.
        //if (submit != null) {
            if ((pathName == null) || (pathName.length()<1)) {
                errors.add("pathName",
                new ActionError("error.pathName.required"));
            }
        //}       
        return errors;
    }
View Full Code Here


         //if (submit != null) {
             // the following fields are required.
           
            if ((driver == null) || (driver.length() < 1)) {
                errors.add("driver",
                new ActionError("error.driver.required"));
            }
        
            if ((roleNameCol == null) || (roleNameCol.length() < 1)) {
                errors.add("roleNameCol",
                new ActionError("error.roleNameCol.required"));
            }

            if ((userNameCol == null) || (userNameCol.length() < 1)) {
                errors.add("userNameCol",
                new ActionError("error.userNameCol.required"));
            }

             if ((passwordCol == null) || (passwordCol.length() < 1)) {
                errors.add("passwordCol",
                new ActionError("error.passwordCol.required"));
            }
           
            if ((userTable == null) || (userTable.length() < 1)) {
                errors.add("userTable",
                new ActionError("error.userTable.required"));
            }
           
            if ((roleTable == null) || (roleTable.length() < 1)) {
                errors.add("roleTable",
                new ActionError("error.roleTable.required"));
            }
           
            if ((connectionName == null) || (connectionName.length() < 1)) {
                errors.add("connectionName",
                new ActionError("error.connectionName.required"));
            }
           
            if ((connectionPassword == null) || (connectionPassword.length() < 1)) {
                errors.add("connectionPassword",
                new ActionError("error.connectionPassword.required"));
            }
           
             if ((connectionURL == null) || (connectionURL.length() < 1)) {
                errors.add("connectionURL",
                new ActionError("error.connectionURL.required"));
            }
        //}
                
        return errors;
    }
View Full Code Here

                                    ",J2EEApplication=none,J2EEServer=none");                  
               
                if (mBServer.isRegistered(oname)) {
                    ActionErrors errors = new ActionErrors();
                    errors.add("contextName",
                               new ActionError("error.contextName.exists"));
                    saveErrors(request, errors);
                    return (new ActionForward(mapping.getInput()));
                }
               
                // Look up our MBeanFactory MBean
View Full Code Here

        // front end validation when save is clicked.
        //if (submit != null) {
           
            // docBase cannot be null
            if ((docBase == null) || (docBase.length() < 1)) {
                errors.add("docBase", new ActionError("error.docBase.required"));
            }
           
            // if path is empty, it's root context
            // validate context starting with "/" only at the time of context creation.
            if ("Create".equalsIgnoreCase(adminAction) && !path.startsWith("/")) {
                errors.add("path", new ActionError("error.path.prefix"));               
            }
                       
            //if ((workDir == null) || (workDir.length() < 1)) {
            //    errors.add("workDir", new ActionError("error.workDir.required"));
            //}
View Full Code Here

    private void numberCheck(String field, String numText, boolean rangeCheck,
    int min, int max) {
       
        // Check for 'is required'
        if ((numText == null) || (numText.length() < 1)) {
            errors.add(field, new ActionError("error."+field+".required"));
        } else {
           
            // check for 'must be a number' in the 'valid range'
            try {
                int num = Integer.parseInt(numText);
                // perform range check only if required
                if (rangeCheck) {
                    if ((num < min) || (num > max ))
                        errors.add( field,
                        new ActionError("error."+ field +".range"));
                }
            } catch (NumberFormatException e) {
                errors.add(field,
                new ActionError("error."+ field + ".format"));
            }
        }
    }
View Full Code Here

        //if (submit != null) {

            // username is a required field
            if ((username == null) || (username.length() < 1)) {
                errors.add("username",
                           new ActionError("users.error.username.required"));
            }

            // uassword is a required field
            if ((password == null) || (username.length() < 1)) {
                errors.add("password",
                           new ActionError("users.error.password.required"));
            }

            // Quotes not allowed in username
            if ((username != null) && (username.indexOf('"') >= 0)) {
                errors.add("username",
                           new ActionError("users.error.quotes"));
            }

            // Quotes not allowed in password
            if ((password != null) && (password.indexOf('"') > 0)) {
                errors.add("description",
                           new ActionError("users.error.quotes"));
            }

            // Quotes not allowed in fullName
            if ((fullName != null) && (fullName.indexOf('"') > 0)) {
                errors.add("fullName",
                           new ActionError("users.error.quotes"));
            }

        //}

        return (errors);
View Full Code Here

                                    ":type=Valve,name=SingleSignOn");              
               
                if (mBServer.isRegistered(oname)) {
                    ActionErrors errors = new ActionErrors();
                    errors.add("singleSignOnValve",
                               new ActionError("error.singleSignOn.exists"));
                    saveErrors(request, errors);
                    return (new ActionForward(mapping.getInput()));
                }
            } catch (Exception e) {
                getServlet().log
View Full Code Here

             server socket on *all* IP addresses for this host */
            if ((address.length() > 0) && !address.equalsIgnoreCase(" ")) {
                try {
                    InetAddress.getByName(address);
                } catch (Exception e) {
                    errors.add("address", new ActionError("error.address.invalid"));
                }
            } else {
                address = " ";
            }
           
            /* ports */
            numberCheck("portNumber",  portText, true, 1, 65535);
            numberCheck("redirectPortText",  redirectPortText, true, -1, 65535);
           
            /* processors*/
            //numberCheck("minProcessorsText",  minProcessorsText, true, 1, 512);
            //try {
                // if min is a valid integer, then check that max >= min
                //int min = Integer.parseInt(minProcessorsText);
                //numberCheck("maxProcessorsText",  maxProcessorsText, true, min, 512);
            //} catch (Exception e) {
                // check for the complete range
                //numberCheck("maxProcessorsText",  maxProcessorsText, true, 1, 512);
            //}
           
            // proxy                 
            if ((proxyName!= null) && (proxyName.length() > 0)) {
                try {
                    InetAddress.getByName(proxyName);
                } catch (Exception e) {
                    errors.add("proxyName", new ActionError("error.proxyName.invalid"));
                }
            }  
           
            // supported only by Coyote HTTP and HTTPS connectors
            if (!("AJP".equalsIgnoreCase(connectorType))) {
View Full Code Here

    public void numberCheck(String field, String numText, boolean rangeCheck,
    int min, int max) {
       
        /* Check for 'is required' */
        if ((numText == null) || (numText.length() < 1)) {
            errors.add(field, new ActionError("error."+field+".required"));
        } else {
           
        /*check for 'must be a number' in the 'valid range'*/
            try {
                int num = Integer.parseInt(numText);
                // perform range check only if required
                if (rangeCheck) {
                    if ((num < min) || (num > max ))
                        errors.add( field,
                        new ActionError("error."+ field +".range"));
                }
            } catch (NumberFormatException e) {
                errors.add(field,
                new ActionError("error."+ field + ".format"));
            }
        }
    }
View Full Code Here

                directory = "logs";
            }

            if ((pattern == null) || (pattern.length() < 1)) {
                errors.add("pattern",
                new ActionError("error.pattern.required"));
            }        
        //}
                
        return errors;
    }
View Full Code Here

TOP

Related Classes of org.apache.struts.action.ActionError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.