dev@jsr311.java.net

Re: JSR311: Re: ResponseBuilder

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 13 Jun 2008 09:24:40 -0400

On Jun 13, 2008, at 9:19 AM, Bill Burke wrote:
>
> type(MediaType)
> type(String)
> language(Locale)
> language(String)
>
+1 to having both variants. The issue, if I understood correctly, is
what type to expect in a message body writer if you get the value of a
header from the httpHeaders parameter.

Marc.

> Stephan Koops wrote:
>> The javadoc of method ResponseBuilder.type(String) says, that the
>> given value must be parseable. This requires to test it, that means
>> typically try to create an instance and see, if no
>> IllegalArgumentException is thrown (the way is not required, but
>> typically). For other objects, e.g. CacheControl or NewCookie it
>> seems useful to me to not serialize them to a String until it is
>> necessary. For consistency it seems good to me to not convert
>> everything to a String, but to leave it as it is, until it is
>> possible.
>> Stephan
>> Bill Burke schrieb:
>>> You don't think using strings is easier? I don't know...
>>>
>>> Marc Hadley wrote:
>>>> On Jun 12, 2008, at 4:34 PM, Stephan Koops wrote:
>>>>>
>>>>> If calling ResponseBuilder.type(String), must the String be
>>>>> converted to a MediaType? Or ResponseBuilder.type(MediaType) be
>>>>> converted to a String? Or should it not changed in both cases?
>>>>> This should be clear if a message body writer would reads data
>>>>> from the Response for necessary casts. A javadoc clarification
>>>>> on both ResponseBuilder.type(.) methods and
>>>>> Response.getMetadata() would be good.
>>>>>
>>>>> The same issue exists for both ResponseBuilder.tag(.)
>>>>>
>>>> I propose we convert to instances of MediaType and EntityTag.
>>>>
>>>>> If HttpHeaders.getAcceptedLanguages() returns List<Locale>, than
>>>>> we should also add ResponseBuilder.language(Locale) and the
>>>>> conversion be documented.
>>>>>
>>>> Yes.
>>>>
>>>> While we are thinking about Locale, anyone have an objection to
>>>> closing issue 42 by switching from String to Locale:
>>>>
>>>> https://jsr311.dev.java.net/issues/show_bug.cgi?id=42
>>>>
>>>> Marc.
>>>>
>>>> ---
>>>> Marc Hadley <marc.hadley at sun.com>
>>>> CTO Office, Sun Microsystems.
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
>>>> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
>> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>

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