dev@jsr311.java.net

Re: Parsing headers, was: Abstract from HTTP <was> Re: Welcome to JSR 311

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 10 Apr 2007 17:27:49 +0200

Dhanji R. Prasanna wrote:
>
>
> On 4/11/07, *Paul Sandoz* <Paul.Sandoz_at_sun.com
> <mailto:Paul.Sandoz_at_sun.com>> wrote:
>
>
> @HeaderParam("Accept") List<MediaType> types
>
> such that either the type or the runtime via the type knows how to
> process the components of the list.
>
>
> I dont think I get this--how would a parameterized List of MediaType
> indicate to the runtime that index 0 is a component type
> [foo/bar;ext="a,b"] and index 1 is [text/plain].
> I think Im missing something basic here...
>

Because:

1) the runtime knows the Accept header value can be a comma separated
list of media type values; and

2) either MediaType or the runtime, via the knowledge of the MediaType
class, knows how to parse a media type as specified by the HTTP grammar.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109