From the course: Jakarta EE Servlets

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

HTTP response messages

HTTP response messages - Jakarta EE Tutorial

From the course: Jakarta EE Servlets

HTTP response messages

- [Kevin] After a servlet receives an HTTP request and finishes processing it, it must then return an HTTP response message to the client. The response message allows the servlet to provide the client with information about the success or failure of its request and optionally, any data that's associated with it, so a servlet might use the response to return some search results or to indicate that it successfully created a new record in the database. Let's take a quick look and see how the response message works. It's going to seem familiar to you because it has the same high level structure as an HTTP request message. It contains sections for a start line, headers, and a body. The main difference between an HTTP request message and an HTTP response message is the start line. The start line of the response is much simpler than the start line of the request. Like the request, it also specifies the version of the HTTP…

Contents