Comments on: How to create a custom JSF Validator – The Greater Than Validator to enforce one component's value being larger than some other's Friends of Oracle and Java Thu, 21 May 2015 20:49:51 +0000 hourly 1 By: Jeff Luo Tue, 30 Jan 2007 20:27:45 +0000 The validator needs to implement StateHolder. See javax.faces.validator.DoubleRangeValidator for implementation details.

By: Ravi Mon, 22 Jan 2007 12:49:06 +0000 Hi Lucas,
Thanks for the reply and i had checked the application for the items u have specified ,din’t find any thing missing out there by me
In GreaterThanValidatorTag which extends ValidatorTag
public void setGreaterThanId(String greaterThanId) {
this.greaterThanId = greaterThanId;

public String getGreaterThanId() {
return greaterThanId;
public void release() {
greaterThanId = null;
for setting greaterThanId

In MyTag.tld

Validator – Enforce that Component’s value is GreaterThan other Component’s Value


Brief snippet showing how to use this tag.

and in Jsf Jsp page only

where form is provided with id “form1″

please comment any thing need to be configured more to use this Custom Validations effectively

By: Lucas Jellema Sat, 13 Jan 2007 10:39:15 +0000 Hi Ravi,

My first hunch would be that in the GreaterThanValidatorTag class you have not implemented the setter method in the correct way. However, perhaps even more likely is that you have not defined the attribute greaterThanId to the Tag Library Description.

Did you specify the value of the greaterThanId correctly in the JSP JSF page? You are not by any chance using the validator in a table component ?


By: Ravi Fri, 12 Jan 2007 12:51:49 +0000 I had incorparated this Validation in my application , but only Client side validation is working fine and if correct(valid) values are provided then it is Throwing Null pointer Exception at the line jsf.validator.GreaterThanValidator.validate( ie at
UIComponent greaterThanComponent =

on debuging the code i found that “greaterThanId” is passed as null in the GreaterThanValidator class Object
need to know any mistake done by me as i tested the sample application too which is working fine

any help please

thanks in advance.