jsr369-experts@servlet-spec.java.net

[jsr369-experts] Re: [servlet-spec users] Re: Re: Re: Re: Re: Re: Re: Re: Re: revised trailer proposals

From: Greg Wilkins <gregw_at_webtide.com>
Date: Fri, 21 Apr 2017 09:44:03 +1000

On 21 April 2017 at 08:33, Shing Wai Chan <shing.wai.chan_at_oracle.com> wrote:

> Let me summarize what we discussed in #getTrailers and with additional
> comemnts.
>
> I. Return null?
>

OK

Was there an issue II?


> III. Trailer vs Trailers.
> Should we rename our API as
> #getTrailerFields, #setTrailerFields or
> #getTrailer, #setTrailer?
> I prefer the former.
>

I still prefer #getTrailers, but if we have to change then
#getTrailerFields is second choice.



> III. The data structure for trailer.
>
Currently choice is between:

   1. Map<String, String> - lower case keys, multiple fields merged.
   2. TreeMap<String, String> - case insensitive, multiple fields merged.
   3. Map<String, List<String>> - lower case keys, inconvenient
   4. TreeMap<String, List<String>> - case insensitive, inconvenient
   5. List<Map.Entry<String,String>> - ugly, very inconvenient

1. is simplest and probably sufficient
4. is most correct against the RFCs but a minor pain to use.

So I prefer either of those, but could lump any of the above.

cheers


-- 
Greg Wilkins <gregw@webtide.com> CTO http://webtide.com