dev@jsr311.java.net

Re: JSR311: form-urlencoded question

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Wed, 26 Mar 2008 15:39:16 -0400

On Mar 26, 2008, at 11:57 AM, Bill Burke wrote:
>>>
>> For consistency with @Path we need to add a:
>> boolean encode() default true;
>> property to each of @PathParam, @QueryParam, @MatrixParam and
>> @DefaultValue.
>
> Then @Encoded goes away? I rather like that annotation over an
> annotation attribute.
>
Currently @Encoded only applies to the value of the reference
parameter, not its name. I suppose we could extend it to mean that the
Param value is also encoded. I.e.

@GET
void get(@Encoded @QueryParam("a%20b") String ab)

means get the value of the "a b" query parameter and don't decode it.

@Path is tricky though, currently @Encoded on a class is equivalent to
setting @Encoded on all parameters of all resource methods, that would
have to change if we wanted to apply @Encoded to @Path and drop the
encode property.

Marc.

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.