users@jersey.java.net

Re: [Jersey] validation???

From: Bruno Vernay <brunovern.a_at_gmail.com>
Date: Tue, 12 May 2009 11:23:07 +0200

Hi,
As I am reading the JAXB doc, there is schema validation
https://jaxb.dev.java.net/tutorial/section_3_3-Validation.html#Validation
But it uses XSD, which isn't very friendly.

Paul, in your example, you show a immutable object "Range" with an
annotated constructor. Is it used by JAXB ???
I thought that JAXB was using only an empty constructor and then
accessed the fields with byte code enhancement. So this created a
problem since it bypasses any validation.

Do you know a way to instruct JAXB to use a specific constructor ?
That would indeed allow validation.

Thanks
Bruno


On Tue, May 12, 2009 at 10:43 AM, Paul Sandoz <Paul.Sandoz_at_sun.com> wrote:
> Hi Keith,
> There is no validation framework provided by Jersey.
> Some developers are using the Bean Validation Framework. See the following
> thread:
> http://markmail.org/search/?q=list%3Anet.java.dev.jersey.users+validation#query:list%3Anet.java.dev.jersey.users%20validation%20order%3Adate-backward+page:1+mid:3qhjvhnozilsuzmn+state:results
> IIRC other developers may be using some AOP-based solutions to validate
> resource method parameters.
> Hope this helps,
> Paul.
> On May 12, 2009, at 12:38 AM, Treague, Keith wrote:
>
> Is there any support in jersey for validating incoming data? I’d prefer this
> sort of thing to be handled by the framework like Spring MVC or even Struts
> 2 however I’m not seeing any integrated validation framework in Jersey.
>
> Keith Treague
>



-- 
Bruno VERNAY