Reply To: Spring JSF with Pretty Faces

Splash Forums Rewrite Users Spring JSF with Pretty Faces Reply To: Spring JSF with Pretty Faces

#25635

The stack trace is telling you the problem:

java.lang.ClassCastException: java.lang.String cannot be cast to com.oaots.tool.bean.jsf.employee.UserSessionJ

Since you do not supply a Converter via .convertedBy(...) from String to UserSession, UserValidator must be of generic type Validator<String>. Otherwise, how would Rewrite know what type to pass, and how to convert to that type?

public class UserValidator implements Validator<String> {

  @Override
  public boolean isValid(Rewrite event, EvaluationContext context, String value) {
     return false; // etc
  }

}