I have made a new Seam validator:

```
    package validators;

import java.io.Serializable;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.faces.Validator;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.log.Log;
import org.jboss.seam.log.Logging;

@Name("roCountyValidator")
@Validator
@BypassInterceptors
public class RoCountyValidator implements javax.faces.validator.Validator,
        Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -3876319398131645955L;
    Log log = Logging.getLog(RoCountyValidator.class);

    public void validate(FacesContext context, UIComponent component,
            Object value) throws ValidatorException {
        log.info("validating....!");
        if (String.valueOf(value).equals("Arad"))
            ((UIInput) component).setValid(true);
        else {
            ((UIInput) component).setValid(false);
            FacesMessage message = new FacesMessage();
            message.setDetail("Invalid county");
            message.setSeverity(FacesMessage.SEVERITY_ERROR);
            throw new ValidatorException(message);
        }
    }
}

```

The problem is that I do not know how to use it directly from jsf...

The following does not work....

I have declared it in a special taglib file: myvalidators.taglib.xml

```
<facelet-taglib>
<namespace>http://example.com/jsf/my/validators</namespace>
<tag>
    <tag-name>roCountyValidator</tag-name>
    <validator>
        <validator-id>roCountyValidator</validator-id>
    </validator>
</tag>

```

and tried to use it like:

```
<h:inputText id="someField" value="#{booking.creditCardName}" 
                               required="true" label="County">
                <my:roCountyValidator/>
                <h:message for="someField"/>
            </h:inputText>

```

Can you tell me where I am wrong?

Thanks.