Skip to main content

Does JSF 2.0 supports JSR-303

5 replies [Last post]
beaupral
Offline
Joined: 2009-03-18
Points: 0

Hi,

Please help me as I am confused. Does JSF 2.0 integrate with JSR-303 (Bean Validation) ? I've read some blog saying that you could trigger JSR-303 validation using tags such as or .

However, I don't see such tags in Mojarra project tlds.

Thanks,
Alex

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
beaupral
Offline
Joined: 2009-03-18
Points: 0

Well, turns out JSF 2.0 offer a nice support for JSR 3.0 :)

I simply removed the jsf-facelet.jar from my classpath and the FaceletViewHandler from my faces-config.xml. Those aren't needed anymore with JSF2.0.

Turns out I don't even the need the "validateBean" tag, has the validation is done automatically on the JSR-303 annoted fields. Impresive!

However, for some reasons my JSTL is not working anymore, but I guess this must be a common issue.

Lincoln Baxter, III

Look at the tag :)

It is supported as long as Mojarra can detect your beanvalidation jars.

On Thu, Feb 11, 2010 at 3:03 PM, wrote:

> Hi,
>
> Please help me as I am confused. Does JSF 2.0 integrate with JSR-303 (Bean
> Validation) ? I've read some blog saying that you could trigger JSR-303
> validation using tags such as or .
>
> However, I don't see such tags in Mojarra project tlds.
>
> Thanks,
> Alex
> [Message sent by forum member 'beaupral' (beaupre_a@hotmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=386214
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
[att1.html]

beaupral
Offline
Joined: 2009-03-18
Points: 0

Thanks, but I've tried the tag and I'm getting the following error

Tag Library supports namespace: http://java.sun.com/jsf/core, but no tag was defined for name: validateBean

Wich suggest to me that the validateBean tag is not defined in the TLD. Also, I can't find any implementation for this tag inside Mojarra project (wich I beleive is ValidatorBeanTag class).

I'm using Mojarra 2.0.2, Jsf-Facelets and Hibernate-Validator 4.0.2

Am I missing dependencies ??

Thanks!

Lincoln Baxter, III

Are you sure you've supplied the correct version (2.0) in your
faces-config.xml file?

If it's set to 1.2, you won't get the new features of JSF2.

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">

--Lincoln

On Thu, Feb 11, 2010 at 3:41 PM, wrote:

> Thanks, but I've tried the tag and I'm getting the following error
>
> Tag Library supports namespace: http://java.sun.com/jsf/core, but no tag
> was defined for name: validateBean
>
> Wich suggest to me that the validateBean tag is not defined in the TLD.
> Also, I can't find any implementation for this tag inside Mojarra project
> (wich I beleive is ValidatorBeanTag class).
>
> I'm using Mojarra 2.0.2, Jsf-Facelets and Hibernate-Validator 4.0.2
>
> Am I missing dependencies ??
>
> Thanks!
> [Message sent by forum member 'beaupral' (beaupre_a@hotmail.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=386240
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: webtier-help@glassfish.dev.java.net
>
>

--
Lincoln Baxter, III
http://ocpsoft.com
http://scrumshark.com
"Keep it Simple"
[att1.html]

beaupral
Offline
Joined: 2009-03-18
Points: 0

Yes, it is set to 2.0

I did some more investigation and notice that the jsf-impl.jar shipped with "Java EE 6 SDKs (Last Updated: December 10, 2009)" does have a validateBean tag entry in the file META-INF/jsf_core.tld (Manisfest file suggests that the version is 2.0.0-Beta2).

However, I can't find the implementation class that is specified in that same entry : com.sun.faces.taglib.jsf_core.BeanValidatorTag

Do you know where should this implementation be ? Why isn't it part of that jar ? And more importantly, why doesn't Mojarra 2.0.2 have the validateBean entry in the taglib ?

Thanks!