dev@jsr311.java.net

Re: JSR311: Reason phrase

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 14 Aug 2008 15:05:27 -0400

On Aug 14, 2008, at 2:34 PM, Craig McClanahan wrote:

> Marc Hadley wrote:
>> For impls based on Servlet I don't see how you could propagate a
>> custom reason phrase, setStatus and sendError just support an int
>> for status code.
>>
> The second variant of HttpServletResponse.sendError() takes both an
> integer status code and a string message. That message gets sent as
> the reason phrase.
>
Not according to the Javadoc:
void sendError(int sc, String msg) throws IOException
Sends an error response to the client using the specified status. The
server defaults to creating the response to look like an HTML-
formatted server error page containing the specified message, setting
the content type to "text/html", leaving cookies and other headers
unmodified. If an error-page declaration has been made for the web
application corresponding to the status code passed in, it will be
served back in preference to the suggested msg parameter.

Marc.

>>
>> On Aug 14, 2008, at 1:40 PM, Bill Burke wrote:
>>
>>> A Seam guy was asking me for the ability to specify the Reason
>>> Phrase of a status code. HTTP 1.1 suggest a reason phrase, but
>>> does not require any specific one.
>>>
>>> Can we add a reason phrase setting to Response?
>>>
>>> --
>>> 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.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
>> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> 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.