Example usage for java.util MissingResourceException getMessage

List of usage examples for java.util MissingResourceException getMessage

Introduction

In this page you can find the example usage for java.util MissingResourceException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:org.cap.selfService.selfRegistration.ui.bean.ContactDetailsBackingBean.java

public String validatePartyPhone() {

    String status = "sucess";
    FacesContext context = FacesContext.getCurrentInstance();
    FacesMessage message = new FacesMessage();
    Pattern p1 = Pattern.compile(expr1);
    Pattern p2 = Pattern.compile(expr2);
    Matcher m1 = p1.matcher((String) getPhonePartyIpTx().getValue());
    Matcher m2 = p2.matcher((String) getPhonePartyIpTx().getValue());

    try {//from   w w w  .  j  a va 2 s  .c o  m

        if (getCountryPartySelOneCho() != null && (getCountryPartySelOneCho().getValue().equals("US")
                || getCountryPartySelOneCho().getValue().equals("CA"))) {

            if (!m1.find() && !m2.find()) {
                message.setDetail(resourceBundle.getString("PHONE_FORMAT"));
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                context.addMessage(getPhonePartyIpTx().getClientId(context), message);
                status = "failure";
            }
        }
    } catch (MissingResourceException e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    }
    return status;
}

From source file:org.cap.selfService.selfRegistration.ui.bean.ContactDetailsBackingBean.java

public String validateNewInstPhone() {

    String status = "sucess";
    FacesMessage message = new FacesMessage();
    FacesContext context = FacesContext.getCurrentInstance();

    Pattern p1 = Pattern.compile(expr1);
    Pattern p2 = Pattern.compile(expr2);

    Matcher m1 = p1.matcher((String) getPhoneBusNewInstIpTx().getValue());
    Matcher m2 = p2.matcher((String) getPhoneBusNewInstIpTx().getValue());

    try {//from  ww w  . jav  a  2  s .  com
        if (getCountryBusNewInstSelOneCho() != null && (getCountryBusNewInstSelOneCho().getValue().equals("US")
                || getCountryBusNewInstSelOneCho().getValue().equals("CA"))) {
            if (!m1.find() && !m2.find()) {
                message.setDetail(resourceBundle.getString("PHONE_FORMAT"));
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                context.addMessage(getPhoneBusNewInstIpTx().getClientId(context), message);
                status = "failure";
            }
        }
    } catch (MissingResourceException e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    }
    return status;
}

From source file:org.cap.selfService.selfRegistration.ui.bean.ContactDetailsBackingBean.java

public String validateNewInstFax() {

    String status = "sucess";
    FacesMessage message = new FacesMessage();
    FacesContext context = FacesContext.getCurrentInstance();
    Pattern p1 = Pattern.compile(expr1);
    Pattern p2 = Pattern.compile(expr2);

    Matcher m1 = p1.matcher((String) getFaxBusNewInstIpTx().getValue());
    Matcher m2 = p2.matcher((String) getFaxBusNewInstIpTx().getValue());

    try {// www .  ja  v a  2s.  c  o m
        if (getCountryBusNewInstSelOneCho() != null && (getCountryBusNewInstSelOneCho().getValue().equals("US")
                || getCountryBusNewInstSelOneCho().getValue().equals("CA"))) {
            if (!m1.find() && !m2.find()) {
                message.setDetail(resourceBundle.getString("FAX_FORMAT"));
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                context.addMessage(getFaxBusNewInstIpTx().getClientId(context), message);
                status = "failure";
            }
        }

    } catch (MissingResourceException e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    }
    return status;
}

From source file:org.cap.selfService.selfRegistration.ui.bean.ContactDetailsBackingBean.java

public String validateHomePhone() {

    String status = "sucess";
    FacesMessage message = new FacesMessage();
    FacesContext context = FacesContext.getCurrentInstance();
    Pattern p1 = Pattern.compile(expr1);
    Pattern p2 = Pattern.compile(expr2);

    Matcher m1 = p1.matcher((String) getPhoneHomeIpTx().getValue());
    Matcher m2 = p2.matcher((String) getPhoneHomeIpTx().getValue());

    try {// www .  j a  v a  2s  .  co  m
        if (getCountryHomeSelOneCho() != null && (getCountryHomeSelOneCho().getValue().equals("US")
                || getCountryHomeSelOneCho().getValue().equals("CA"))) {
            if (!m1.find() && !m2.find()) {
                message.setDetail(resourceBundle.getString("PHONE_FORMAT"));
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                context.addMessage(getPhoneHomeIpTx().getClientId(context), message);
                status = "failure";
            }
        }

    } catch (MissingResourceException e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    }
    return status;
}

From source file:org.cap.selfService.selfRegistration.ui.bean.ContactDetailsBackingBean.java

public String validateHomeFax() {

    String status = "sucess";
    FacesMessage message = new FacesMessage();
    FacesContext context = FacesContext.getCurrentInstance();
    Pattern p1 = Pattern.compile(expr1);
    Pattern p2 = Pattern.compile(expr2);

    Matcher m1 = p1.matcher((String) getFaxHomeIpTx().getValue());
    Matcher m2 = p2.matcher((String) getFaxHomeIpTx().getValue());

    try {/*  www .j a va 2  s.  co  m*/

        if (getCountryHomeSelOneCho() != null && (getCountryHomeSelOneCho().getValue().equals("US")
                || getCountryHomeSelOneCho().getValue().equals("CA"))) {
            if (!m1.find() && !m2.find()) {
                message.setDetail(resourceBundle.getString("FAX_FORMAT"));
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                context.addMessage(getFaxHomeIpTx().getClientId(context), message);
                status = "failure";
            }
        }

    } catch (MissingResourceException e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    }
    return status;
}

From source file:davmail.exchange.dav.DavExchangeSession.java

protected String getTimezoneIdFromExchange() {
    String timezoneId = null;//from   ww w. j  av  a  2s.c o  m
    String timezoneName = null;
    try {
        Set<String> attributes = new HashSet<String>();
        attributes.add("roamingdictionary");

        MultiStatusResponse[] responses = searchItems("/users/" + getEmail() + "/NON_IPM_SUBTREE", attributes,
                isEqualTo("messageclass", "IPM.Configuration.OWA.UserOptions"),
                DavExchangeSession.FolderQueryTraversal.Deep, 1);
        if (responses.length == 1) {
            byte[] roamingdictionary = getBinaryPropertyIfExists(responses[0].getProperties(HttpStatus.SC_OK),
                    "roamingdictionary");
            if (roamingdictionary != null) {
                timezoneName = getTimezoneNameFromRoamingDictionary(roamingdictionary);
                if (timezoneName != null) {
                    timezoneId = ResourceBundle.getBundle("timezoneids").getString(timezoneName);
                }
            }
        }
    } catch (MissingResourceException e) {
        LOGGER.warn("Unable to retrieve Exchange timezone id for name " + timezoneName);
    } catch (UnsupportedEncodingException e) {
        LOGGER.warn("Unable to retrieve Exchange timezone id: " + e.getMessage(), e);
    } catch (IOException e) {
        LOGGER.warn("Unable to retrieve Exchange timezone id: " + e.getMessage(), e);
    }
    return timezoneId;
}

From source file:org.cap.selfService.selfRegistration.ui.bean.ContactDetailsBackingBean.java

public String validateReqFlds() {
    FacesContext context = FacesContext.getCurrentInstance();

    String status = "sucess";
    try {//from   w  w  w.j a va  2  s.  c  o m
        if (getAddressOptionsRdBtn().getValue().equals("business")
                || (getAddressOptionsRdBtn().getValue().equals("businesshome"))) {
            if (getInstitutionOptionsRdBtn().getValue().equals("browseInst")) {

                if (getPartyNameIpLOV().getValue() == null
                        || (getPartyNameIpLOV().getValue() != null
                                && getPartyNameIpLOV().getValue().toString().trim().equals(""))
                        || (getPartyNameIpLOV().getValue() != null
                                && getPartyNameIpLOV().getValue().toString().trim().equals(""))) {

                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_INSTNAME_REQ"));
                    context.addMessage(getPartyNameIpLOV().getClientId(context), message);
                } else {
                    if (getAddress1PartyIpTx().getValue() == null || (getAddress1PartyIpTx().getValue() != null
                            && getAddress1PartyIpTx().getValue().toString().trim().equals(""))) {

                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_ADDR1_REQ"));
                        context.addMessage(getAddress1PartyIpTx().getClientId(context), message);
                    }
                    if (getCountryPartySelOneCho().getValue() == null
                            || (getCountryPartySelOneCho().getValue() != null
                                    && getCountryPartySelOneCho().getValue().equals(""))) {

                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_COUNTRY_REQ"));
                        context.addMessage(getCountryPartySelOneCho().getClientId(context), message);
                    }
                    if (getCityPartyIpTx().getValue() == null || (getCityPartyIpTx().getValue() != null
                            && getCityPartyIpTx().getValue().toString().trim().equals(""))) {

                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_CITY_REQ"));
                        context.addMessage(getCityPartyIpTx().getClientId(context), message);
                    }
                    if (getPhonePartyIpTx().getValue() == null || (getPhonePartyIpTx().getValue() != null
                            && getPhonePartyIpTx().getValue().toString().trim().equals(""))) {

                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_PHONE_REQ"));
                        context.addMessage(getPhonePartyIpTx().getClientId(context), message);
                    }

                    if (getPhonePartyIpTx().getValue() != null
                            && !getPhonePartyIpTx().getValue().toString().trim().equals("")) {
                        String phoneStatus = validatePartyPhone();
                        if (phoneStatus.equals("failure")) {
                            status = "failure";
                        }
                    }
                    if (getFaxPartyIpTx().getValue() != null
                            && !getFaxPartyIpTx().getValue().toString().trim().equals("")) {
                        String faxStatus = validatePartyFax();
                        if (faxStatus.equals("failure")) {
                            status = "failure";
                        }
                    }
                    if (getCountryPartySelOneCho().getValue() != null) {

                        if (getCountryPartySelOneCho().getValue().equals("US")) {
                            if (getStatesUSPartySelOneCho().getValue() == null
                                    || (getStatesUSPartySelOneCho().getValue() != null
                                            && getStatesUSPartySelOneCho().getValue().equals(""))) {

                                status = "failure";
                                FacesMessage message = new FacesMessage();
                                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                                context.addMessage(getStatesUSPartySelOneCho().getClientId(context), message);
                            }
                            if (getPostalCodePartyIpTx().getValue() == null
                                    || (getPostalCodePartyIpTx().getValue() != null && getPostalCodePartyIpTx()
                                            .getValue().toString().trim().equals(""))) {

                                status = "failure";
                                FacesMessage message = new FacesMessage();
                                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                message.setDetail(resourceBundle.getString("BUS_ZIP_REQ"));
                                context.addMessage(getPostalCodePartyIpTx().getClientId(context), message);
                            }
                        }
                        if (getCountryPartySelOneCho().getValue() != null
                                && getCountryPartySelOneCho().getValue().equals("AU")) {

                            if (getStatesAUPartySelOneCho().getValue() == null
                                    || (getStatesAUPartySelOneCho().getValue() != null
                                            && getStatesAUPartySelOneCho().getValue().equals(""))) {

                                status = "failure";
                                FacesMessage message = new FacesMessage();
                                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                                context.addMessage(getStatesAUPartySelOneCho().getClientId(context), message);
                            }
                        }
                        if (getCountryPartySelOneCho().getValue() != null
                                && getCountryPartySelOneCho().getValue().equals("CA")) {
                            if (getStatesCAPartySelOneCho().getValue() == null
                                    || (getStatesCAPartySelOneCho().getValue() != null
                                            && getStatesCAPartySelOneCho().getValue().equals(""))) {

                                status = "failure";
                                FacesMessage message = new FacesMessage();
                                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                                context.addMessage(getStatesCAPartySelOneCho().getClientId(context), message);
                            }
                            if (getPostalCodePartyIpTx().getValue() == null
                                    || (getPostalCodePartyIpTx().getValue() != null && getPostalCodePartyIpTx()
                                            .getValue().toString().trim().equals(""))) {

                                status = "failure";
                                FacesMessage message = new FacesMessage();
                                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                message.setDetail(resourceBundle.getString("BUS_ZIP_REQ"));
                                context.addMessage(getPostalCodePartyIpTx().getClientId(context), message);
                            }
                        }

                        //party zipcode validation
                        if (getPostalCodePartyIpTx().getValue() != null
                                && !getPostalCodePartyIpTx().getValue().toString().trim().equals("")) {
                            FacesMessage message = new FacesMessage();
                            Pattern p4 = Pattern.compile(expr4);
                            Pattern p5 = Pattern.compile(expr5);
                            Matcher m4 = p4.matcher((String) getPostalCodePartyIpTx().getValue());
                            Matcher m5 = p5.matcher((String) getPostalCodePartyIpTx().getValue());
                            if (getCountryPartySelOneCho() != null
                                    && getCountryPartySelOneCho().getValue().equals("US")) {
                                if (!m4.find()) {
                                    message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                    context.addMessage(getPostalCodePartyIpTx().getClientId(context), message);
                                    status = "failure";
                                }
                            }
                            if (getCountryPartySelOneCho() != null
                                    && getCountryPartySelOneCho().getValue().equals("CA")) {
                                if (!m5.find()) {
                                    message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                    context.addMessage(getPostalCodePartyIpTx().getClientId(context), message);
                                    status = "failure";
                                }
                            }
                        }
                    }
                }
            }
            if (getInstitutionOptionsRdBtn().getValue().equals("newInst")) {

                if (getInstitutionNameBusNewInstIpTx().getValue() == null
                        || (getInstitutionNameBusNewInstIpTx().getValue() != null
                                && getInstitutionNameBusNewInstIpTx().getValue().toString().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_INSTNAME_REQ"));
                    context.addMessage(getInstitutionNameBusNewInstIpTx().getClientId(context), message);
                }
                if (getAddress1BusNewInstIpTx().getValue() == null
                        || (getAddress1BusNewInstIpTx().getValue() != null
                                && getAddress1BusNewInstIpTx().getValue().toString().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_ADDR1_REQ"));
                    context.addMessage(getAddress1BusNewInstIpTx().getClientId(context), message);
                }
                if (getCountryBusNewInstSelOneCho().getValue() == null
                        || (getCountryBusNewInstSelOneCho().getValue() != null
                                && getCountryBusNewInstSelOneCho().getValue().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_COUNTRY_REQ"));
                    context.addMessage(getCountryBusNewInstSelOneCho().getClientId(context), message);
                }
                if (getCityBusNewInstIpTx().getValue() == null || (getCityBusNewInstIpTx().getValue() != null
                        && getCityBusNewInstIpTx().getValue().toString().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_CITY_REQ"));
                    context.addMessage(getCityBusNewInstIpTx().getClientId(context), message);
                }
                if (getPhoneBusNewInstIpTx().getValue() == null || (getPhoneBusNewInstIpTx().getValue() != null
                        && getPhoneBusNewInstIpTx().getValue().toString().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_PHONE_REQ"));
                    context.addMessage(getPhoneBusNewInstIpTx().getClientId(context), message);
                }
                if (getPhoneBusNewInstIpTx().getValue() != null
                        && !getPhoneBusNewInstIpTx().getValue().toString().equals("")) {
                    String phoneStatus = validateNewInstPhone();
                    if (phoneStatus.equals("failure")) {
                        status = "failure";
                    }
                }
                if (getFaxBusNewInstIpTx().getValue() != null
                        && !getFaxBusNewInstIpTx().getValue().toString().equals("")) {
                    String faxStatus = validateNewInstFax();
                    if (faxStatus.equals("failure")) {
                        status = "failure";
                    }
                }
                if (getCountryBusNewInstSelOneCho().getValue().equals("US")) {
                    if (getStatesUSNewInstSelOneCho().getValue() == null
                            || (getStatesUSNewInstSelOneCho().getValue() != null
                                    && getStatesUSNewInstSelOneCho().getValue().equals(""))) {
                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                        context.addMessage(getStatesUSNewInstSelOneCho().getClientId(context), message);
                    }
                    if (getPostalCodeBusNewInstIpTx().getValue() == null
                            || (getPostalCodeBusNewInstIpTx().getValue() != null
                                    && getPostalCodeBusNewInstIpTx().getValue().toString().trim().equals(""))) {
                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_ZIP_REQ"));
                        context.addMessage(getPostalCodeBusNewInstIpTx().getClientId(context), message);
                    }
                }
                if (getCountryBusNewInstSelOneCho().getValue().equals("AU")) {
                    if (getStatesAUNewInstSelOneCho().getValue() == null
                            || (getStatesAUNewInstSelOneCho().getValue() != null
                                    && getStatesAUNewInstSelOneCho().getValue().equals(""))) {
                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                        context.addMessage(getStatesAUNewInstSelOneCho().getClientId(context), message);
                    }
                }
                if (getCountryBusNewInstSelOneCho().getValue().equals("CA")) {
                    if (getStatesCANewInstSelOneCho().getValue() == null
                            || (getStatesCANewInstSelOneCho().getValue() != null
                                    && getStatesCANewInstSelOneCho().getValue().equals(""))) {
                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                        context.addMessage(getStatesCANewInstSelOneCho().getClientId(context), message);
                    }
                    if (getPostalCodeBusNewInstIpTx().getValue() == null
                            || (getPostalCodeBusNewInstIpTx().getValue() != null
                                    && getPostalCodeBusNewInstIpTx().getValue().toString().equals(""))) {
                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_ZIP_REQ"));
                        context.addMessage(getPostalCodeBusNewInstIpTx().getClientId(context), message);
                    }
                }
                //new inst zipcode validation
                if (getPostalCodeBusNewInstIpTx().getValue() != null
                        && !getPostalCodeBusNewInstIpTx().getValue().toString().trim().equals("")) {
                    FacesMessage message = new FacesMessage();
                    Pattern p4 = Pattern.compile(expr4);
                    Pattern p5 = Pattern.compile(expr5);
                    Matcher m4 = p4.matcher((String) getPostalCodeBusNewInstIpTx().getValue());
                    Matcher m5 = p5.matcher((String) getPostalCodeBusNewInstIpTx().getValue());
                    if (getCountryBusNewInstSelOneCho() != null
                            && getCountryBusNewInstSelOneCho().getValue().equals("US")) {
                        if (!m4.find()) {
                            message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                            message.setSeverity(FacesMessage.SEVERITY_ERROR);
                            context.addMessage(getPostalCodeBusNewInstIpTx().getClientId(context), message);
                            status = "failure";
                        }
                    }
                    if (getCountryBusNewInstSelOneCho() != null
                            && getCountryBusNewInstSelOneCho().getValue().equals("CA")) {
                        if (!m5.find()) {
                            message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                            message.setSeverity(FacesMessage.SEVERITY_ERROR);
                            context.addMessage(getPostalCodeBusNewInstIpTx().getClientId(context), message);
                            status = "failure";
                        }
                    }
                }
            }
        }
        //home
        if (getAddressOptionsRdBtn().getValue().equals("home")
                || (getAddressOptionsRdBtn().getValue().equals("businesshome"))) {

            if (getAddress1HomeIpTx().getValue() == null || (getAddress1HomeIpTx().getValue() != null
                    && getAddress1HomeIpTx().getValue().toString().trim().equals(""))) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail(resourceBundle.getString("HOME_ADDR1_REQ"));
                context.addMessage(getAddress1HomeIpTx().getClientId(context), message);
            }
            if (getCountryHomeSelOneCho().getValue() == null || (getCountryHomeSelOneCho().getValue() != null
                    && getCountryHomeSelOneCho().getValue().equals(""))) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail(resourceBundle.getString("HOME_COUNTRY_REQ"));
                context.addMessage(getCountryHomeSelOneCho().getClientId(context), message);
            }
            if (getCityHomeIpTx().getValue() == null || (getCityHomeIpTx().getValue() != null
                    && getCityHomeIpTx().getValue().toString().trim().equals(""))) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail(resourceBundle.getString("HOME_CITY_REQ"));
                context.addMessage(getCityHomeIpTx().getClientId(context), message);
            }
            if (getPhoneHomeIpTx().getValue() == null || (getPhoneHomeIpTx().getValue() != null
                    && getPhoneHomeIpTx().getValue().toString().trim().equals(""))) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail(resourceBundle.getString("HOME_PHONE_REQ"));
                context.addMessage(getPhoneHomeIpTx().getClientId(context), message);
            }
            if (getPhoneHomeIpTx().getValue() != null
                    && !getPhoneHomeIpTx().getValue().toString().trim().equals("")) {
                String phoneStatus = validateHomePhone();
                if (phoneStatus.equals("failure")) {
                    status = "failure";
                }
            }
            if (getFaxHomeIpTx().getValue() != null
                    && !getFaxHomeIpTx().getValue().toString().trim().equals("")) {
                String faxStatus = validateHomeFax();
                if (faxStatus.equals("failure")) {
                    status = "failure";
                }
            }
            if (getCountryHomeSelOneCho().getValue().equals("US")) {
                if (getStatesUSHomeSelOneCho().getValue() == null
                        || (getStatesUSHomeSelOneCho().getValue() != null
                                && getStatesUSHomeSelOneCho().getValue().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("HOME_STATES_REQ"));
                    context.addMessage(getStatesUSHomeSelOneCho().getClientId(context), message);
                }
                if (getPostalCodeHomeIpTx().getValue() == null || (getPostalCodeHomeIpTx().getValue() != null
                        && getPostalCodeHomeIpTx().getValue().toString().trim().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("HOME_ZIP_REQ"));
                    context.addMessage(getPostalCodeHomeIpTx().getClientId(context), message);
                }
            }
            if (getCountryHomeSelOneCho().getValue().equals("AU")) {
                if (getStatesAUHomeSelOneCho().getValue() == null
                        || (getStatesAUHomeSelOneCho().getValue() != null
                                && getStatesAUHomeSelOneCho().getValue().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("HOME_STATES_REQ"));
                    context.addMessage(getStatesAUHomeSelOneCho().getClientId(context), message);
                }
            }
            if (getCountryHomeSelOneCho().getValue().equals("CA")) {
                if (getStatesCAHomeSelOneCho().getValue() == null
                        || (getStatesCAHomeSelOneCho().getValue() != null
                                && getStatesCAHomeSelOneCho().getValue().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("HOME_STATES_REQ"));
                    context.addMessage(getStatesCAHomeSelOneCho().getClientId(context), message);
                }
                if (getPostalCodeHomeIpTx().getValue() == null || (getPostalCodeHomeIpTx().getValue() != null
                        && getPostalCodeHomeIpTx().getValue().toString().trim().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("HOME_ZIP_REQ"));
                    context.addMessage(getPostalCodeHomeIpTx().getClientId(context), message);
                }
            }
            //home zipcode validation
            if (getPostalCodeHomeIpTx().getValue() != null
                    && !getPostalCodeHomeIpTx().getValue().toString().trim().equals("")) {
                FacesMessage message = new FacesMessage();
                Pattern p4 = Pattern.compile(expr4);
                Pattern p5 = Pattern.compile(expr5);
                Matcher m4 = p4.matcher((String) getPostalCodeHomeIpTx().getValue());
                Matcher m5 = p5.matcher((String) getPostalCodeHomeIpTx().getValue());
                if (getCountryHomeSelOneCho() != null && getCountryHomeSelOneCho().getValue().equals("US")) {
                    if (!m4.find()) {

                        message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        context.addMessage(getPostalCodeHomeIpTx().getClientId(context), message);
                        status = "failure";
                    }
                }
                if (getCountryHomeSelOneCho() != null && getCountryHomeSelOneCho().getValue().equals("CA")) {
                    if (!m5.find()) {
                        message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        context.addMessage(getPostalCodeHomeIpTx().getClientId(context), message);
                        status = "failure";
                    }
                }
            }
        }
        //businesshome
        if ((getAddressOptionsRdBtn().getValue().equals("businesshome"))) {
            if (getAddressPreferenceRdBtn().getValue() == null) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail(resourceBundle.getString("ADDR_OPTIONS_REQ"));
                context.addMessage(getAddressPreferenceRdBtn().getClientId(context), message);
            }
        }
        if (getLicenseNumberIpTx().getValue() != null && !getLicenseNumberIpTx().getValue().equals("")) {
            String expression = "^[A-Za-z][A-Za-z][0-9]{1,20}$";
            Pattern p1 = Pattern.compile(expression);
            Matcher m1 = p1.matcher((String) getLicenseNumberIpTx().getValue());
            if (!m1.find()) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail("Please enter the proper value");
                context.addMessage(getLicenseNumberIpTx().getClientId(context), message);
            }
        }
    } catch (MissingResourceException e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    } catch (Exception e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    }
    return status;
}

From source file:org.cap.selfService.myAccount.ui.bean.AddressBookBackingBean.java

public String validatePartyFax() {

    String status = "sucess";
    FacesMessage message = new FacesMessage();
    FacesContext context = FacesContext.getCurrentInstance();
    Pattern p1 = Pattern.compile(expr1);
    Pattern p2 = Pattern.compile(expr2);

    Matcher m1 = p1.matcher((String) getFaxPartyIpTx().getValue());
    Matcher m2 = p2.matcher((String) getFaxPartyIpTx().getValue());

    try {//from w ww.  ja  v  a  2s  .  co m
        if (getCountryPartySelOneCho() != null && (getCountryPartySelOneCho().getValue().equals("US")
                || getCountryPartySelOneCho().getValue().equals("CA"))) {
            if (!m1.find() && !m2.find()) {
                message.setDetail(resourceBundle.getString("FAX_FORMAT"));
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                context.addMessage(getFaxPartyIpTx().getClientId(context), message);
                status = "failure";
            }
        }

    } catch (MissingResourceException e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    }
    return status;
}

From source file:org.cap.selfService.myAccount.ui.bean.AddressBookBackingBean.java

public String validatePartyPhone() {

    String status = "sucess";
    FacesContext context = FacesContext.getCurrentInstance();
    FacesMessage message = new FacesMessage();
    Pattern p1 = Pattern.compile(expr1);
    Pattern p2 = Pattern.compile(expr2);

    Matcher m1 = p1.matcher((String) getPhonePartyIpTx().getValue());
    Matcher m2 = p2.matcher((String) getPhonePartyIpTx().getValue());

    try {/* w w w  . jav  a 2 s .c  o m*/

        if (getCountryPartySelOneCho() != null && (getCountryPartySelOneCho().getValue().equals("US")
                || getCountryPartySelOneCho().getValue().equals("CA"))) {

            if (!m1.find() && !m2.find()) {
                message.setDetail(resourceBundle.getString("PHONE_FORMAT"));
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                context.addMessage(getPhonePartyIpTx().getClientId(context), message);
                status = "failure";
            }
        }
    } catch (MissingResourceException e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    }
    return status;
}

From source file:org.cap.selfService.myAccount.ui.bean.AddressBookBackingBean.java

public String validateReqFlds() {
    FacesContext context = FacesContext.getCurrentInstance();

    String status = "sucess";
    try {/*from w w w . jav a 2s  .co  m*/
        if (getAddressOptionsRdBtn().getValue().equals("business")
                || (getAddressOptionsRdBtn().getValue().equals("businesshome"))) {
            if (getInstitutionOptionsRdBtn().getValue().equals("browseInst")) {

                if (getPartyNameIpLOV().getValue() == null
                        || (getPartyNameIpLOV().getValue() != null
                                && getPartyNameIpLOV().getValue().toString().trim().equals(""))
                        || (getPartyNameIpLOV().getValue() != null
                                && getPartyNameIpLOV().getValue().toString().trim().equals(""))) {

                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_INSTNAME_REQ"));
                    context.addMessage(getPartyNameIpLOV().getClientId(context), message);
                } else {
                    if (getAddress1PartyIpTx().getValue() == null || (getAddress1PartyIpTx().getValue() != null
                            && getAddress1PartyIpTx().getValue().toString().trim().equals(""))) {

                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_ADDR1_REQ"));
                        context.addMessage(getAddress1PartyIpTx().getClientId(context), message);
                    }
                    if (getCountryPartySelOneCho().getValue() == null
                            || (getCountryPartySelOneCho().getValue() != null
                                    && getCountryPartySelOneCho().getValue().equals(""))) {

                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_COUNTRY_REQ"));
                        context.addMessage(getCountryPartySelOneCho().getClientId(context), message);
                    }
                    if (getCityPartyIpTx().getValue() == null || (getCityPartyIpTx().getValue() != null
                            && getCityPartyIpTx().getValue().toString().trim().equals(""))) {

                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_CITY_REQ"));
                        context.addMessage(getCityPartyIpTx().getClientId(context), message);
                    }
                    if (getPhonePartyIpTx().getValue() == null || (getPhonePartyIpTx().getValue() != null
                            && getPhonePartyIpTx().getValue().toString().trim().equals(""))) {

                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_PHONE_REQ"));
                        context.addMessage(getPhonePartyIpTx().getClientId(context), message);
                    }

                    if (getPhonePartyIpTx().getValue() != null
                            && !getPhonePartyIpTx().getValue().toString().trim().equals("")) {
                        String phoneStatus = validatePartyPhone();
                        if (phoneStatus.equals("failure")) {
                            status = "failure";
                        }
                    }
                    if (getFaxPartyIpTx().getValue() != null
                            && !getFaxPartyIpTx().getValue().toString().trim().equals("")) {
                        String faxStatus = validatePartyFax();
                        if (faxStatus.equals("failure")) {
                            status = "failure";
                        }
                    }
                    if (getCountryPartySelOneCho().getValue() != null) {

                        if (getCountryPartySelOneCho().getValue().equals("US")) {

                            if (getStatesUSPartySelOneCho().getValue() == null
                                    || (getStatesUSPartySelOneCho().getValue() != null
                                            && getStatesUSPartySelOneCho().getValue().equals(""))) {

                                status = "failure";
                                FacesMessage message = new FacesMessage();
                                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                                context.addMessage(getStatesUSPartySelOneCho().getClientId(context), message);
                            }
                            if (getPostalCodePartyIpTx().getValue() == null
                                    || (getPostalCodePartyIpTx().getValue() != null && getPostalCodePartyIpTx()
                                            .getValue().toString().trim().equals(""))) {

                                status = "failure";
                                FacesMessage message = new FacesMessage();
                                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                message.setDetail(resourceBundle.getString("BUS_ZIP_REQ"));
                                context.addMessage(getPostalCodePartyIpTx().getClientId(context), message);
                            }
                        }
                        if (getCountryPartySelOneCho().getValue() != null
                                && getCountryPartySelOneCho().getValue().equals("AU")) {

                            if (getStatesAUPartySelOneCho().getValue() == null
                                    || (getStatesAUPartySelOneCho().getValue() != null
                                            && getStatesAUPartySelOneCho().getValue().equals(""))) {

                                status = "failure";
                                FacesMessage message = new FacesMessage();
                                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                                context.addMessage(getStatesAUPartySelOneCho().getClientId(context), message);
                            }
                        }
                        if (getCountryPartySelOneCho().getValue() != null
                                && getCountryPartySelOneCho().getValue().equals("CA")) {
                            if (getStatesCAPartySelOneCho().getValue() == null
                                    || (getStatesCAPartySelOneCho().getValue() != null
                                            && getStatesCAPartySelOneCho().getValue().equals(""))) {

                                status = "failure";
                                FacesMessage message = new FacesMessage();
                                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                                context.addMessage(getStatesCAPartySelOneCho().getClientId(context), message);
                            }
                            if (getPostalCodePartyIpTx().getValue() == null
                                    || (getPostalCodePartyIpTx().getValue() != null && getPostalCodePartyIpTx()
                                            .getValue().toString().trim().equals(""))) {

                                status = "failure";
                                FacesMessage message = new FacesMessage();
                                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                message.setDetail(resourceBundle.getString("BUS_ZIP_REQ"));
                                context.addMessage(getPostalCodePartyIpTx().getClientId(context), message);
                            }
                        }

                        //party zipcode validation
                        if (getPostalCodePartyIpTx().getValue() != null
                                && !getPostalCodePartyIpTx().getValue().toString().trim().equals("")) {
                            FacesMessage message = new FacesMessage();
                            Pattern p4 = Pattern.compile(expr4);
                            Pattern p5 = Pattern.compile(expr5);
                            Matcher m4 = p4.matcher((String) getPostalCodePartyIpTx().getValue());
                            Matcher m5 = p5.matcher((String) getPostalCodePartyIpTx().getValue());
                            if (getCountryPartySelOneCho() != null
                                    && getCountryPartySelOneCho().getValue().equals("US")) {
                                if (!m4.find()) {
                                    message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                    context.addMessage(getPostalCodePartyIpTx().getClientId(context), message);
                                    status = "failure";
                                }
                            }
                            if (getCountryPartySelOneCho() != null
                                    && getCountryPartySelOneCho().getValue().equals("CA")) {
                                if (!m5.find()) {
                                    message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                                    context.addMessage(getPostalCodePartyIpTx().getClientId(context), message);
                                    status = "failure";
                                }
                            }
                        }
                    }
                }
            }
            if (getInstitutionOptionsRdBtn().getValue().equals("newInst")) {

                if (getInstitutionNameBusNewInstIpTx().getValue() == null
                        || (getInstitutionNameBusNewInstIpTx().getValue() != null
                                && getInstitutionNameBusNewInstIpTx().getValue().toString().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_INSTNAME_REQ"));
                    context.addMessage(getInstitutionNameBusNewInstIpTx().getClientId(context), message);
                }
                if (getAddress1BusNewInstIpTx().getValue() == null
                        || (getAddress1BusNewInstIpTx().getValue() != null
                                && getAddress1BusNewInstIpTx().getValue().toString().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_ADDR1_REQ"));
                    context.addMessage(getAddress1BusNewInstIpTx().getClientId(context), message);
                }
                if (getCountryBusNewInstSelOneCho().getValue() == null
                        || (getCountryBusNewInstSelOneCho().getValue() != null
                                && getCountryBusNewInstSelOneCho().getValue().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_COUNTRY_REQ"));
                    context.addMessage(getCountryBusNewInstSelOneCho().getClientId(context), message);
                }
                if (getCityBusNewInstIpTx().getValue() == null || (getCityBusNewInstIpTx().getValue() != null
                        && getCityBusNewInstIpTx().getValue().toString().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_CITY_REQ"));
                    context.addMessage(getCityBusNewInstIpTx().getClientId(context), message);
                }
                if (getPhoneBusNewInstIpTx().getValue() == null || (getPhoneBusNewInstIpTx().getValue() != null
                        && getPhoneBusNewInstIpTx().getValue().toString().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("BUS_PHONE_REQ"));
                    context.addMessage(getPhoneBusNewInstIpTx().getClientId(context), message);
                }
                if (getPhoneBusNewInstIpTx().getValue() != null
                        && !getPhoneBusNewInstIpTx().getValue().toString().equals("")) {
                    String phoneStatus = validateNewInstPhone();
                    if (phoneStatus.equals("failure")) {
                        status = "failure";
                    }
                }
                if (getFaxBusNewInstIpTx().getValue() != null
                        && !getFaxBusNewInstIpTx().getValue().toString().equals("")) {
                    String faxStatus = validateNewInstFax();
                    if (faxStatus.equals("failure")) {
                        status = "failure";
                    }
                }
                if (getCountryBusNewInstSelOneCho().getValue().equals("US")) {
                    if (getStatesUSNewInstSelOneCho().getValue() == null
                            || (getStatesUSNewInstSelOneCho().getValue() != null
                                    && getStatesUSNewInstSelOneCho().getValue().equals(""))) {
                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                        context.addMessage(getStatesUSNewInstSelOneCho().getClientId(context), message);
                    }
                    if (getPostalCodeBusNewInstIpTx().getValue() == null
                            || (getPostalCodeBusNewInstIpTx().getValue() != null
                                    && getPostalCodeBusNewInstIpTx().getValue().toString().trim().equals(""))) {
                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_ZIP_REQ"));
                        context.addMessage(getPostalCodeBusNewInstIpTx().getClientId(context), message);
                    }
                }
                if (getCountryBusNewInstSelOneCho().getValue().equals("AU")) {
                    if (getStatesAUNewInstSelOneCho().getValue() == null
                            || (getStatesAUNewInstSelOneCho().getValue() != null
                                    && getStatesAUNewInstSelOneCho().getValue().equals(""))) {
                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                        context.addMessage(getStatesAUNewInstSelOneCho().getClientId(context), message);
                    }
                }
                if (getCountryBusNewInstSelOneCho().getValue().equals("CA")) {
                    if (getStatesCANewInstSelOneCho().getValue() == null
                            || (getStatesCANewInstSelOneCho().getValue() != null
                                    && getStatesCANewInstSelOneCho().getValue().equals(""))) {
                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_STATES_REQ"));
                        context.addMessage(getStatesCANewInstSelOneCho().getClientId(context), message);
                    }
                    if (getPostalCodeBusNewInstIpTx().getValue() == null
                            || (getPostalCodeBusNewInstIpTx().getValue() != null
                                    && getPostalCodeBusNewInstIpTx().getValue().toString().equals(""))) {
                        status = "failure";
                        FacesMessage message = new FacesMessage();
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        message.setDetail(resourceBundle.getString("BUS_ZIP_REQ"));
                        context.addMessage(getPostalCodeBusNewInstIpTx().getClientId(context), message);
                    }
                }
                //new inst zipcode validation
                if (getPostalCodeBusNewInstIpTx().getValue() != null
                        && !getPostalCodeBusNewInstIpTx().getValue().toString().trim().equals("")) {
                    FacesMessage message = new FacesMessage();
                    Pattern p4 = Pattern.compile(expr4);
                    Pattern p5 = Pattern.compile(expr5);
                    Matcher m4 = p4.matcher((String) getPostalCodeBusNewInstIpTx().getValue());
                    Matcher m5 = p5.matcher((String) getPostalCodeBusNewInstIpTx().getValue());
                    if (getCountryBusNewInstSelOneCho() != null
                            && getCountryBusNewInstSelOneCho().getValue().equals("US")) {
                        if (!m4.find()) {
                            message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                            message.setSeverity(FacesMessage.SEVERITY_ERROR);
                            context.addMessage(getPostalCodeBusNewInstIpTx().getClientId(context), message);
                            status = "failure";
                        }
                    }
                    if (getCountryBusNewInstSelOneCho() != null
                            && getCountryBusNewInstSelOneCho().getValue().equals("CA")) {
                        if (!m5.find()) {
                            message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                            message.setSeverity(FacesMessage.SEVERITY_ERROR);
                            context.addMessage(getPostalCodeBusNewInstIpTx().getClientId(context), message);
                            status = "failure";
                        }
                    }
                }
            }
        }
        //home
        if (getAddressOptionsRdBtn().getValue().equals("home")
                || (getAddressOptionsRdBtn().getValue().equals("businesshome"))) {

            if (getAddress1HomeIpTx().getValue() == null || (getAddress1HomeIpTx().getValue() != null
                    && getAddress1HomeIpTx().getValue().toString().trim().equals(""))) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail(resourceBundle.getString("HOME_ADDR1_REQ"));
                context.addMessage(getAddress1HomeIpTx().getClientId(context), message);
            }
            if (getCountryHomeSelOneCho().getValue() == null || (getCountryHomeSelOneCho().getValue() != null
                    && getCountryHomeSelOneCho().getValue().equals(""))) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail(resourceBundle.getString("HOME_COUNTRY_REQ"));
                context.addMessage(getCountryHomeSelOneCho().getClientId(context), message);
            }
            if (getCityHomeIpTx().getValue() == null || (getCityHomeIpTx().getValue() != null
                    && getCityHomeIpTx().getValue().toString().trim().equals(""))) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail(resourceBundle.getString("HOME_CITY_REQ"));
                context.addMessage(getCityHomeIpTx().getClientId(context), message);
            }
            if (getPhoneHomeIpTx().getValue() == null || (getPhoneHomeIpTx().getValue() != null
                    && getPhoneHomeIpTx().getValue().toString().trim().equals(""))) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail(resourceBundle.getString("HOME_PHONE_REQ"));
                context.addMessage(getPhoneHomeIpTx().getClientId(context), message);
            }
            if (getPhoneHomeIpTx().getValue() != null
                    && !getPhoneHomeIpTx().getValue().toString().trim().equals("")) {
                String phoneStatus = validateHomePhone();
                if (phoneStatus.equals("failure")) {
                    status = "failure";
                }
            }
            if (getFaxHomeIpTx().getValue() != null
                    && !getFaxHomeIpTx().getValue().toString().trim().equals("")) {
                String faxStatus = validateHomeFax();
                if (faxStatus.equals("failure")) {
                    status = "failure";
                }
            }
            if (getCountryHomeSelOneCho().getValue().equals("US")) {
                if (getStatesUSHomeSelOneCho().getValue() == null
                        || (getStatesUSHomeSelOneCho().getValue() != null
                                && getStatesUSHomeSelOneCho().getValue().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("HOME_STATES_REQ"));
                    context.addMessage(getStatesUSHomeSelOneCho().getClientId(context), message);
                }
                if (getPostalCodeHomeIpTx().getValue() == null || (getPostalCodeHomeIpTx().getValue() != null
                        && getPostalCodeHomeIpTx().getValue().toString().trim().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("HOME_ZIP_REQ"));
                    context.addMessage(getPostalCodeHomeIpTx().getClientId(context), message);
                }
            }
            if (getCountryHomeSelOneCho().getValue().equals("AU")) {
                if (getStatesAUHomeSelOneCho().getValue() == null
                        || (getStatesAUHomeSelOneCho().getValue() != null
                                && getStatesAUHomeSelOneCho().getValue().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("HOME_STATES_REQ"));
                    context.addMessage(getStatesAUHomeSelOneCho().getClientId(context), message);
                }
            }
            if (getCountryHomeSelOneCho().getValue().equals("CA")) {
                if (getStatesCAHomeSelOneCho().getValue() == null
                        || (getStatesCAHomeSelOneCho().getValue() != null
                                && getStatesCAHomeSelOneCho().getValue().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("HOME_STATES_REQ"));
                    context.addMessage(getStatesCAHomeSelOneCho().getClientId(context), message);
                }
                if (getPostalCodeHomeIpTx().getValue() == null || (getPostalCodeHomeIpTx().getValue() != null
                        && getPostalCodeHomeIpTx().getValue().toString().trim().equals(""))) {
                    status = "failure";
                    FacesMessage message = new FacesMessage();
                    message.setSeverity(FacesMessage.SEVERITY_ERROR);
                    message.setDetail(resourceBundle.getString("HOME_ZIP_REQ"));
                    context.addMessage(getPostalCodeHomeIpTx().getClientId(context), message);
                }
            }
            //home zipcode validation
            if (getPostalCodeHomeIpTx().getValue() != null
                    && !getPostalCodeHomeIpTx().getValue().toString().trim().equals("")) {
                FacesMessage message = new FacesMessage();
                Pattern p4 = Pattern.compile(expr4);
                Pattern p5 = Pattern.compile(expr5);
                Matcher m4 = p4.matcher((String) getPostalCodeHomeIpTx().getValue());
                Matcher m5 = p5.matcher((String) getPostalCodeHomeIpTx().getValue());
                if (getCountryHomeSelOneCho() != null && getCountryHomeSelOneCho().getValue().equals("US")) {
                    if (!m4.find()) {

                        message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        context.addMessage(getPostalCodeHomeIpTx().getClientId(context), message);
                        status = "failure";
                    }
                }
                if (getCountryHomeSelOneCho() != null && getCountryHomeSelOneCho().getValue().equals("CA")) {
                    if (!m5.find()) {
                        message.setDetail(resourceBundle.getString("ZIPFORMAT"));
                        message.setSeverity(FacesMessage.SEVERITY_ERROR);
                        context.addMessage(getPostalCodeHomeIpTx().getClientId(context), message);
                        status = "failure";
                    }
                }
            }
        }
        if ((getAddressOptionsRdBtn().getValue().equals("businesshome"))) {
            if (getAddressPreferenceRdBtn().getValue() == null) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail(resourceBundle.getString("ADDR_OPTIONS_REQ"));
                context.addMessage(getAddressPreferenceRdBtn().getClientId(context), message);
            }
        }

        if (getLicenseNumberIpTx().getValue() != null && !getLicenseNumberIpTx().getValue().equals("")
                && !getLicenseNumberIpTx().isReadOnly()) {
            String expression = "^[A-Za-z][A-Za-z][0-9]{1,20}$";
            Pattern p1 = Pattern.compile(expression);
            Matcher m1 = p1.matcher((String) getLicenseNumberIpTx().getValue());
            if (!m1.find()) {
                status = "failure";
                FacesMessage message = new FacesMessage();
                message.setSeverity(FacesMessage.SEVERITY_ERROR);
                message.setDetail("Invalid License Number");
                context.addMessage(getLicenseNumberIpTx().getClientId(context), message);
            }
        }
    } catch (MissingResourceException e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    } catch (Exception e) {
        sLog.debug(e.getMessage(), e);
        e.printStackTrace();
    }
    return status;
}