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

From: Julian Reschke <>
Date: Tue, 10 Apr 2007 12:29:06 +0200

Jerome Louvel schrieb:
> Hi Paul and Julian,
>> In HTTP, a header can have list type, the list values either being
>> comma-separated or on additional header lines (or both). See
>> <>.
>> The trouble here is that in order to parse a header like that, the
>> application needs to known about the syntax of the list elements. For
>> instance, If-Match can have multiple ETags, and ETags can contain a
>> comma. Thus, servlets frequently get this wrong. So any kind of
>> assistance in parsing things like that would be great.
> I would suggest the following approach:
> public void setTags(@Context("header.Slug") List<String> tags){
> ...
> }

You lost me here. "Slug" is not of type list...

> The detection of a List of String would automatically trigger the
> normalization and parsing of the Slug header(s) according to HTTP headers
> parsing rules.
> I'm not sure if other types of parsing (RFC2047) should be supported by
> default beside the common HTTP header parsing, but I don't know what RFC2047
> actually adds in this area, so I'm open on this.

It adds the ability to represent non-ISO8859 characters in headers.

Best regards, Julian