|
From: Ryan J. M. <ry...@da...> - 2008-07-30 03:39:41
|
Hey Rafael,
I just committed a FormUrlEncodedObjectProvider which does mostly what
you want. To get it to work, you must annotate the value object with
the @FormValues annotation, and each field that needs to be annotated
with a @FormParam annotation. There's a unit test in src/test that
shows how it all fits together. Going forward, here's what I'd like/
need to do:
* support @Encoded
* Don't require @FormParam if the field name matches the parameter name
* improve error handling
Let me know if this is where your thinking was at?
Ryan-
On Jul 29, 2008, at 10:43 AM, Rafael Pereira Nunes wrote:
> Probably we will have the same limitations of standard action.
> If you have a reference to other object/composition I can´t see how
> to do this kind of injection.
> Like if the address in Person object was another Object instead a
> String.
>
> class Person{
> String name;
> int age;
> Address address;
> }
>
> How do you think in how to do that in a neat way?
>
> Feature Request opened:
> https://jira.jboss.org/jira/browse/RESTEASY-85
>
> I´m finishing some integration examples of RestEasy with another
> platforms(Adobe Flex, Python, Ruby, HttpClient...) and I could help
> with this feature if you want.
>
> --Rafael
> -----Mensagem original-----
> De: Ryan J. McDonough [mailto:ry...@da...]
> Enviada em: terça-feira, 29 de julho de 2008 10:01
> Para: Rafael Pereira Nunes
> Cc: res...@li...
> Assunto: Re: [Resteasy-developers] Mapping Parameters to Object
>
> HA HA! I have to chuckle a bit because this is some that Bill was
> trying to get into the JAX-RS spec but it got shot down. I think this
> is something that'll end up being a RESTEasy-specific feature, and I
> know it's something Bill was very interested in doing. In fact, I can
> think of a pretty neat way to do it too. If you can, please open a
> feature request for it so we don't for get ;) I'm finishing up some
> JAXB stuff now.
>
> Ryan-
>
> On Jul 28, 2008, at 10:34 AM, Rafael Pereira Nunes wrote:
>
>> I was thinking about something that I cannot found in any REST
>> framework(Restlet, Jersey, CXF...).
>> I would like to see something like the standard action of
>> JSP(<jsp:setProperty property="*">) when I found request parameters
>> that
>> matches with my object attributes I inject them.
>>
>> Something like:
>>
>> @POST
>> public void someMethod(Person person){...}
>>
>> And in the client:
>>
>> POST Body
>> name=John
>> age=25
>> gender=M
>> addres=blablabla
>>
>> And I inject them with:
>> person.setName("John")
>> person.setAge(25)
>> person.setGender('M')
>> person.setAddress("blablabla")
>>
>> And can see some problems with that, but not impossible to do.
>>
>> Is this possible? Or is it just a nonsense dream?
>>
>>
>> Rafael
>>
>>
>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win
>> great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in
>> the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> Resteasy-developers mailing list
>> Res...@li...
>> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
>
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win
> great prizes
> Grand prize is a trip for two to an Open Source event anywhere in
> the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
|