Package org.apache.struts.action

Examples of org.apache.struts.action.ActionError


            err = true;
        }

        if ( err )
        {
            errors.add( "ActionForm", new ActionError( msg ) );
        }
    }
View Full Code Here


                             String       msg,
                             ActionErrors errors )
    {
        if ( ( value == null ) || ( value.length(  ) < len ) )
        {
            errors.add( "ActionForm", new ActionError( msg ) );
        }
    }
View Full Code Here

                               String       msg,
                               ActionErrors errors )
    {
        if ( ( value == null ) || ( value.trim(  ).length(  ) == 0 ) )
        {
            errors.add( "ActionForm", new ActionError( msg ) );
        }
    }
View Full Code Here

public class Validator {
    public static boolean validateRequired(String fieldValue,
                                           String fieldName,
                                           ActionErrors errors){
        if(fieldValue==null||fieldValue.length()==0){
            errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(
                    WebErrorCodes.ERROR_REQUIRED, fieldName));
            return false;
        }
        return true;
    }
View Full Code Here

                                          String fieldName,
                                          ActionErrors errors){
        try {
            Integer.parseInt(fieldValue);
        } catch (NumberFormatException e) {
            errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(
                    WebErrorCodes.ERROR_INVALID, fieldName));
            return false;
        }
        return true;
    }
View Full Code Here

                }
            }
            ActionErrors errors = new ActionErrors();
            if(invalidValue){
                errors.add(ActionErrors.GLOBAL_ERROR,
                        new ActionError(ErrorCodes.INVALID_CHAR_APP_NAME));
                return errors;
            }else if(nullValue && !validValue){
                errors.add(ActionErrors.GLOBAL_ERROR,
                        new ActionError("errors.required", "application name"));
                return errors;
            }
            return null;
        }else{
            final String configName = request.getParameter("name");
            ActionErrors errors = new ActionErrors();
            if(GenericValidator.isBlankOrNull(configName)){
                errors.add(ActionErrors.GLOBAL_ERROR,
                        new ActionError("errors.required", "application name"));
                return errors;
            }else if(configName.indexOf("/") != -1){
                errors.add(ActionErrors.GLOBAL_ERROR,
                        new ActionError(ErrorCodes.INVALID_CHAR_APP_NAME));
                return errors;
            }else{
                return null;
            }
        }
View Full Code Here

    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request){
        ActionErrors errors = super.validate(mapping, request);
        if(errors==null || errors.isEmpty()){
            if(name.indexOf("/") != -1){
                errors.add(ActionErrors.GLOBAL_ERROR,
                        new ActionError(ErrorCodes.INVALID_CHAR_APP_NAME));
            }
            ApplicationType appType = ApplicationTypes.getApplicationType(type);
            MetaApplicationConfig metaAppConfig =
                    appType.getModule().getMetaApplicationConfig();
            if(metaAppConfig.isDisplayHost()){
View Full Code Here

                CoreServlet.getServlet().fireCoreEvent(evt);
                throw e;
            }
        }
        else{
            errs.add(Globals.ERROR_KEY, new ActionError("vfs.paste.from.clipboard.no.copy"));
            this.saveErrors(request, errs);
        }
  }
View Full Code Here

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

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.