users@jersey.java.net

Re: [Jersey] Formparam for Non-String Fields

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 17 Dec 2009 11:17:48 +0100

On Dec 17, 2009, at 11:06 AM, Cemo Koc wrote:

>
> Hi Paul,
>
> Thank you so much for your detailed explanation. I agree with your all
> explanations.
>
> Returning error for empty strings and non-digit string is making
> useless for
> number fields unfortunately.

Yes, and generally for any non-String type where instances of that
type are created from a String value the same issue can arise.

I had recently considered that Jersey should attempt to obtain all
injected values. If one or more exceptions are thrown when obtaining
the values that all exceptions should be reported, being wrapped
around an uber-exception. Then an ExceptionMapper could be utilized.


> Now I will change these fields as you stated.
>
> I also agreed with you improving error returning usage in terms of
> user
> perspective.
>
> Maybe spec of the JSR-311 can be revised again to use bean validation
> framework. I read that There is not intersection parts between
> JSR-303 and
> JSR-311. However now I believe that especially after support of form
> beans,
> support of bean validation natively by Jersey or JSR-311 spec can be
> great.
> :)
>

Yes, we originally thought that the application would be responsible
for validating. But, there are potentially some things we might be
able to do, like using AOP as we have discussed.

Paul.