dev@jsr311.java.net

Re: JSR311: _at_Cookie

From: Bill Burke <bburke_at_redhat.com>
Date: Tue, 12 Feb 2008 18:34:58 -0500

Dhanji R. Prasanna wrote:
>
>
> On Feb 13, 2008 7:51 AM, Marc Hadley <Marc.Hadley_at_sun.com
> <mailto:Marc.Hadley_at_sun.com>> wrote:
>
> On Feb 12, 2008, at 4:17 PM, Dhanji R. Prasanna wrote:
> > > Hmm. Not a bad idea. Why not:
> > >
> > > public Response get(@Param("cookieName") javax.servlet...Cookie
> > > cookie);
> > >
> > > ?
> > >
> > Do you mean @HeaderParam or a new annotation @Param ?
> >
> > I meant an existing @Param. I must have missed the header prefix. My
> > specific intention was not to create another annotation just for
> > cookies.
> >
> So the value of @HeaderParam would be the cookie name if the class of
> the annotated parameter is Cookie but the HTTP header name for any
> other type ?
>
>
> Exactly.
>
> Though your "source" enum sounds interesting too.
>
> Dhanji.

@HeaderParam doesn't work with cookie headers

Cookie: name=value;name=value;name=value


I want to be able to do

public void method(@CookieParam("foo") int val)

without having to get a Cookie object and do
Integer.valueOf(cookie.getValue());





-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com