Hi
On 05/09/14 11:28, Vjacheslav V. Borisov wrote:
Hi !

Currently in apache cxf possible to do basic bean injection:
     @POST
     @Consumes("application/x-www-form-urlencoded")
     public Response createProcessInstanceForm(@FormParam("")
CreateProcessInstanceRequest createprocessinstancerequest) {
}

Can I write provider to realise custom form POST
(application/x-www-form-urlencoded) or
GET (query param) to bean injection or with intemediate step
application/x-www-form-urlencoded -> xml -> bean (jaxb unmarashall) )?

You can use JAX-RS 2.0 @BeanParam annotation with a bean whose individual properties are annotated with @FormParam. Or write a custom MessageBodyReader which takes a form payload and populates a bean. Another option is to use MultivaluedMap to capture all the form properties in a map

HTH, Sergey

Reply via email to