Reply To: Spring JSF with Pretty Faces

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



Please provide simple example for VaildateBy method

public class UserValidator implements Validator<UserSessionJ> {

public boolean isValid(Rewrite rwrt, EvaluationContext ec, UserSessionJ t) {

boolean isValid = false;

if (t.getSessionId().equals(t.getToken())) {
System.out.println(“userValidator – true”);
return true;
System.out.println(“userValidator – false”);

return isValid;


java.lang.ClassCastException: java.lang.String cannot be cast to com.oaots.tool.bean.jsf.employee.UserSessionJ
at com.oaots.tool.web.jsf.validator.UserValidator.isValid(
at org.ocpsoft.rewrite.util.ValueHolderUtil.validates(
at org.ocpsoft.rewrite.faces.config.PhaseBinding.performHttp(
at org.ocpsoft.rewrite.servlet.config.HttpOperation.perform(
at org.ocpsoft.rewrite.faces.config.PhaseOperation$1.performOperation(
at org.ocpsoft.rewrite.faces.RewritePhaseListener$1.performInSubflow(
at org.ocpsoft.rewrite.servlet.event.SubflowTask.perform(


users do not enter direct url like /example1/{session}/home.xhtml instead of /example1/home.xhtml. How to validate?

if user go to /example1/home.xhtml this way automatically session logout and then redirect to login page.

How to show the error to user using ValidateBy or match cases