Problem with HTTPStatus coes
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Paul_Hunnisett
Posted On:   Tuesday, November 5, 2002 03:02 AM

I am trying to write an implementation of some of the Servlet specification, primarily for education purposes. I am trying to run a third party web application on my server in order to test how well I am achieving my aims. This application seems to be trying to rtead the status code for the response, but it is failing because I have not implememted the setStatus() method on the HttpServletResponse yet. This is because I'm not sure how! I can see that the method simply takes in a int, but what should I do with this int? If I understood exactly how this code would be retreived it would help. Is it part of the headers? If so, how would I add that string to the headers? Any help would be gratefully appreciated.    More>>

I am trying to write an implementation of some of the Servlet specification, primarily for education purposes. I am trying to run a third party web application on my server in order to test how well I am achieving my aims. This application seems to be trying to rtead the status code for the response, but it is failing because I have not implememted the setStatus() method on the HttpServletResponse yet. This is because I'm not sure how!

I can see that the method simply takes in a int, but what should I do with this int?

If I understood exactly how this code would be retreived it would help. Is it part of the headers? If so, how would I add that string to the headers?

Any help would be gratefully appreciated.

   <<Less

Re: Problem with HTTPStatus coes

Posted By:   Jorgen_Nordqvist  
Posted On:   Wednesday, November 6, 2002 02:51 PM

The status line is the first line in the HTTP response header, as shown in the following snippet from RFC-2616:


6 Response

After receiving and interpreting a request message, a server responds
with an HTTP response message.

Response = Status-Line ; Section 6.1
*(( general-header ; Section 4.5
| response-header ; Section 6.2
| entity-header ) CRLF) ; Section 7.1
CRLF
[ message-body ] ; Section 7.2

6.1 Status-Line

The first line of a Response message is the Status-Line, consisting
of the protocol version followed by a numeric status code and its
associated textual phrase, with each element separated by SP
characters. No CR or LF is allowed except in the final CRLF sequence.

Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF

6.1.1 Status Code and Reason Phrase

The Status-Code element is a 3-digit integer result code of the
attempt to understand and satisfy the request. These codes are fully
defined in section 10. The Reason-Phrase is intended to give a short
textual description of the Status-Code. The Status-Code is intended
for use by automata and the Reason-Phrase is intended for the human
user. The client is not required to examine or display the Reason-
Phrase.


Jorgen

About | Sitemap | Contact