aspose file tools*
The moose likes JSF and the fly likes JSF Validation not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF Validation not working" Watch "JSF Validation not working" New topic
Author

JSF Validation not working

vivek ja
Ranch Hand

Joined: Feb 24, 2005
Posts: 80
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
<validator>

<validator-id>MyValidator</validator-id>

<validator-class>
com.abc.MyValidator
</validator-class>

</validator>

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

Am i doing anything wrong here?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF Validation not working
 
Similar Threads
Custom validator not validating
Problem jsf cutom validation -- validate method dont call
Problem with f:validator & f:attribute - EL does not evalute in f:attribute
Unknown validator id in JSF2
empty space validation