dev@jsr311.java.net

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

From: Julian Reschke <julian.reschke_at_gmx.de>
Date: Tue, 10 Apr 2007 10:33:21 +0200

Paul Sandoz schrieb:
> Julian Reschke wrote:
>>> We have tried to keep the language similar to that of HTTP so it will
>>> be familiar to developers who are familiar with HTTP or can easily
>>> relate to HTTP through the Java documentation (which IDEs can be
>>> present), or are debugging and looking at HTTP messages e.g. using
>>> Firebug with Firefox.
>>>
>>> Similar things could apply for supporting WebDAV.
>>> ...
>>
>> ...which reminds me that I think we should have the goal to make
>> parsing HTTP headers as painless as possible. This includes:
>>
>> - decomposing list-style headers, and
>>
>
> Can you enumerate a bit further on the above?

In HTTP, a header can have list type, the list values either being
comma-separated or on additional header lines (or both). See
<http://greenbytes.de/tech/webdav/rfc2616.html#rfc.section.4.2.p.5>.

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.

> ...

Best regards, Julian