I have a problem with below if condition.
if(!(type=="image/jpeg" || type=="image/png" || type=="image/gif")){
throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, "Only jpeg, png or gif", ""));
}
When type is image/jpeg, it still throws ValidatorException. When I hardcode type directly to image/jpeg, it works. So I hope that you help me, because I really don't know where is problem.