I am trying to use the commons validator framework within my JSP/JSF
project.  I have tomahawk configured with the Sun's JSF 1.1 reference
implementation.

The validateEmail tag works great; however, I cannot get the validateUrl to
work no matter what I try.  I found different examples and documentation re:
the validateUrl tag use in JSP.

For example, a working validateEmail example is this:

   <%@ taglib uri="http://myfaces.apache.org/tomahawk"; prefix="t"%>
    ...
   <h:inputText id="email2"
                   value="#{validateForm.email2}"
                   required="true">
       <t:validateEmail />
   </h:inputText>

The MyFaces source code has a validateUrl tag example with a prefix of s and
I have found it documented on apache's website with prefix of x
(http://myfaces.apache.org/tomahawk/validateUrl.html). I have tried all of
these different syntaxes...

        <t:validateUrl/>
        <s:validateUrl/>
        <x:validateUrl/>
        <f:validator validatorId="org.myfaces.validator.Url" />

I cannot get any of these url validation tag syntaxes to work.  The t, s, x
prefix syntax gives no error and just seems to be ignored.  When I try the
validatorId syntax, I get an exception that the id does not exist.  

I looked in the jar files (tomahawk-1.1.3.jar and
commons-validator-1.3.0.jar) and notice that UrlValidator class is there,
but a Tag class and validate*.js are not in the jar files, like they are for
the email Validator (validateEmail.js and ValidateEqualTag.class).

The jar files I have currently in use are:
        tomahawk-1.1.3.jar
        commons-validator-1.3.0.jar
        commons-beanutils.jar
        jakarta-oro-2.0.8.jar


I looked through the MyFacces message archives and see that there were some
issues with MyFaces 1.1.1, but am unsure of the status of this validateUrl
currently in the latest release.

Can anyone tell me how to use urlValidator in my jsp pages and what jar file
I might be missing OR can anyone tell me if it is just not supported
anymore?

Thanks.

Rich 

Reply via email to