Package org.apache.struts.action

Examples of org.apache.struts.action.ActionError


                ObjectName oname =
                    new ObjectName(objectName);
                if (mBServer.isRegistered(oname)) {
                    ActionErrors errors = new ActionErrors();
                    errors.add("realmName",
                               new ActionError("error.realmName.exists"));
                    saveErrors(request, errors);
                    return (new ActionForward(mapping.getInput()));
                }

                // Look up our MBeanFactory MBean
View Full Code Here


                                   ",service=" + honame.getKeyProperty("service"));
               
                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

                ObjectName oname =
                    new ObjectName(objectName);
                if (mBServer.isRegistered(oname)) {
                    ActionErrors errors = new ActionErrors();
                    errors.add("realmName",
                               new ActionError("error.realmName.exists"));
                    saveErrors(request, errors);
                    return (new ActionForward(mapping.getInput()));
                }

                // Look up our MBeanFactory MBean
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

                                   ",host=" + hform.getHostName() +
                                   ",service=" + serviceName);
                if (mBServer.isRegistered(oname)) {
                    ActionErrors errors = new ActionErrors();
                    errors.add("hostName",
                               new ActionError("error.hostName.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) {
           
            // hostName cannot be null
            if ((hostName== null) || (hostName.length() < 1)) {
                errors.add("hostName", new ActionError("error.hostName.required"));
            }
           
            // appBase cannot be null
            if ((appBase == null) || (appBase.length() < 1)) {
                errors.add("appBase", new ActionError("error.appBase.required"));
            }
           
        }       
        return errors;
       
View Full Code Here

        if ((submit != null)
           && ("FileLogger").equalsIgnoreCase(type)) {
            
            if ((directory == null) || (directory.length() < 1)) {
                errors.add("directory",
                new ActionError("error.directory.required"));
            }
                        
            if ((prefix == null) || (prefix.length() < 1)) {
                errors.add("prefix",
                new ActionError("error.prefix.required"));
            }
                        
            if ((suffix == null) || (suffix.length() < 1)) {
                errors.add("suffix",
                new ActionError("error.suffix.required"));
            }           
        }
       
        return errors;
    }
View Full Code Here

                ObjectName oname =
                    new ObjectName(objectName);
                if (mBServer.isRegistered(oname)) {
                    ActionErrors errors = new ActionErrors();
                    errors.add("realmName",
                               new ActionError("error.realmName.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("/")) {
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

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.