I am currently trying to validate user input on a JSF xhtml page. I would like to print out the error message and keep the program going for next input/transaction after the exception is caught. Is it possible?
Log or throw more exception only brings me to a broken page but I would like to have the user to have a chance to reenter.
if(!input.equals("")){
try{
String sanitized = Sanitizer.sanitizeInput(input);
if(sanitized.equals("")){
throw new UnsafeInputException("Please try again.");
}
} catch(UnsafeInputException err){
// what should I do here?
}
}