File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF Validation not working

vivek ja
Ranch Hand
Posts: 80
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to do the validation using JSF validator interface.
For some reason the control is not reaching m y validator code at all.
I tried a system.out inside the method and its not printing out.
Any help is appreciated!

Here is my code:

public class MyValidator implements Validator {
public void validate(FacesContext context, UIComponent uiComponent,
Object object) throws ValidatorException {
System.out.println("in the validator method");
validateSomething(context, uiComponent, object);

In the faces-config i have




In the JSP i have
<TD class="textBoxNew">
<h:inputText id="text1" value="#{UserBean.field1}" >
<f:validator validatorId="MyValidator"/></h:inputText>

Am i doing anything wrong here?
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic