users@jersey.java.net

Re: Get rid of requirement for no-arg constructor

From: Richard Wallace <rwallace_at_thewallacepack.net>
Date: Thu, 29 Nov 2007 19:37:01 -0800

Paul Sandoz wrote:
> Richard Wallace wrote:
>>> Such a parameter can be String, or a class that supports a
>>> constructor with a String parameter or a static method of the
>>> signature "T valueOf(String)". Plus such information can only be
>>> obtained in a per-request scope from the HTTP request.
>>>
>>
>> Maybe this is out of left field, but have you had a look at how
>> WebWork/Struts2 handles conversion? It's really slick, allowing you
>> to specify different Converters, etc. so you don't have to rely on
>> static methods or naming conventions or anything like that. I think
>> doing something like this within Jersey or even spec'ing this as a
>> requirement in jsr311 would be awesome.
>>
>
> Could you send a pointer and/or provide an example?
>
> See also this issue [1].
>
> Paul.
>
> [1] https://jersey.dev.java.net/issues/show_bug.cgi?id=15
>
Sorry. Here you go.

http://struts.apache.org/2.0.11/docs/type-conversion.html


The validation is top notch too.

http://struts.apache.org/2.0.11/docs/validation.html

Interceptors would be really useful too.

http://struts.apache.org/2.0.11/docs/interceptors.html


Rich