import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.convert.ConverterException;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
AddressbookEmailAddressValidator.CONTACT_BEAN = (ContactSessionBeanRemote) initialContext.lookup("java:global/addressbook-ejb/contact!org.mxchange.jcontacts.contact.ContactSessionBeanRemote"); //NOI18N
} catch (final NamingException ex) {
// Continue to throw it
- throw new ConverterException(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage()), ex); //NOI18N
+ throw new ValidatorException(new FacesMessage(MessageFormat.format("initialContext.lookup() failed: {0}", ex.getMessage())), ex); //NOI18N
}
}
super.preValidate(context, component, value, requiredFields, true);
// Parse value as string first
- String dial = String.valueOf(value);
+ String dialNumber = String.valueOf(value);
// Is it not +?
- if (!dial.equals("+")) { //NOI18N
+ if (!dialNumber.equals("+")) { //NOI18N
// No, then try to ...
try {
// ..parse as number
- Long number = Long.parseLong(dial);
+ Long number = Long.parseLong(dialNumber);
// Not valid range? (1 - 99, very rude)
if (number < 1 || number > 99) {