users@jersey.java.net

Re: [Jersey] extracting request parameters in custom object

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Fri, 30 Jul 2010 15:55:54 +0200

Hi Michael,

Do the following:

   public Response toRepresentation(@Inject CustomRequestObject obj)

where @Inject is Jersey's version and nothing related JSR-330 or CDI.

Paul.

On Jul 7, 2010, at 3:22 AM, Michael Mogley wrote:

> I would like to refactor my request extraction annotations into a
> separate value object. Is there a way to do this in Jersey? I'm
> envisioning something like:
>
> public Response toRepresentation(CustomRequestObject obj)
> {
> ...
> }
>
> public class CustomRequestObject
> {
> @QueryParam("name")
> private String name;
>
> @QueryParam("id")
> private Long id;
> }
>
> Is something like this possible?
>
> Michael
>
> --
> Michael Mogley, Software Architect
> Wirefree Thought LLC