-
1. Re: Integration between Weld + JSR 303 Bean Validation?
gavin.king Nov 3, 2009 11:53 PM (in response to sboscarine)The only integration that we have in the spec is that you can inject the default ValidationFactory and Validator. (See section 3.6)
If you want something beyond that, you need to write an interceptor.
Note that JPA 2.0 also features transparent integration with 303.
-
2. Re: Integration between Weld + JSR 303 Bean Validation?
asookazian Nov 6, 2009 8:55 PM (in response to sboscarine)Because validation in web apps is essential, it would be nice if CDI/Weld supported the same validations that Seam 2.x supports: business validation via custom classes and Hibernate Validators with <s:validate>.
How is the integration with other parts/specs of JEE 6? i.e. JSF, JPA, web services, etc? are custom interceptors required there as well? I assume it's mostly DI-based...
-
3. Re: Integration between Weld + JSR 303 Bean Validation?
sboscarine Nov 6, 2009 9:34 PM (in response to sboscarine)
Arbi Sookazian wrote on Nov 06, 2009 20:55:
Because validation in web apps is essential, it would be nice if CDI/Weld supported the same validations that Seam 2.x supports: business validation via custom classes and Hibernate Validators with <s:validate>.Sounds like a JSF 2.0 request :) Isn't <s:validate> a feature of the view tier?
Hopefully someone will write something that translates JSR 303 to JavaScript as well as server side validation in a convenient and easy-to-use fashion.
To me, server side validation is a failsafe. Users hate server-side validation. The more you can do in JavaScript, the happier your users will be.
-
4. Re: Integration between Weld + JSR 303 Bean Validation?
asookazian Nov 6, 2009 10:34 PM (in response to sboscarine)
To me, server side validation is a failsafe. Users hate server-side validation. The more you can do in JavaScript, the happier your users will be.JS only works if the user has enabled it in their browser. SS validation is less performant. But Hibernate Validators and <s:validate> uses SS validation. In fact, all validation is SS in JSF, no?
-
5. Re: Integration between Weld + JSR 303 Bean Validation?
pmuir Nov 7, 2009 4:05 PM (in response to sboscarine)
Arbi Sookazian wrote on Nov 06, 2009 20:55:
Because validation in web apps is essential, it would be nice if CDI/Weld supported the same validations that Seam 2.x supports: business validation via custom classes and Hibernate Validators with <s:validate>.This has been standardized by JSR-303 (the Hibernate Validator bit) and JSF2 (<f:validateBean />.
How is the integration with other parts/specs of JEE 6? i.e. JSF, JPA, web services, etc? are custom interceptors required there as well? I assume it's mostly DI-based...Take a look at the CDI spec, pretty much all the integration is specified there, but for your specific specs:
- Servlet integration supports all Servlet scopes
- JSF integration adds a conversation scope
- JPA integration allows you alias inject entity managers via @EntityManager
- WS integration via @Resource
None of these use or require interceptors.
-
6. Re: Integration between Weld + JSR 303 Bean Validation?
pmuir Nov 7, 2009 4:08 PM (in response to sboscarine)
Steven Boscarine wrote on Nov 06, 2009 21:34:
Arbi Sookazian wrote on Nov 06, 2009 20:55:
Because validation in web apps is essential, it would be nice if CDI/Weld supported the same validations that Seam 2.x supports: business validation via custom classes and Hibernate Validators with <s:validate>.
Sounds like a JSF 2.0 request :) Isn't <s:validate> a feature of the view tier?Yes, we took this largely wholesale from Seam, and made a few improvements along the way. Take a look at JSF 2 spec :-)
Hopefully someone will write something that translates JSR 303 to JavaScript as well as server side validation in a convenient and easy-to-use fashion.
To me, server side validation is a failsafe. Users hate server-side validation. The more you can do in JavaScript, the happier your users will be.Well said :-)
We tried to get to a general solution to client side validation in JSF2, but ran out of time. However we did ensure that Bean Validation contains the necessary hooks for a third party to innovate - expect something from Seam 3 or RichFaces in this area.