Skip to main content

Posts

JSP : Server Response and Http Status Codes

When a Web server responds to a HTTP request, the response typically consists of a status line, some response headers, a blank line, and the document. A typical response looks like this − HTTP / 1.1 200 OK Content - Type : text / html Header2 : ... ... HeaderN : ... ( Blank Line ) <! doctype ...> <html> <head> ...</ head > <body> ... </ body > </ html > The status line consists of the HTTP version  (HTTP/1.1 in the example) , a status code  (200 in the example) , and a very short message corresponding to the status code  (OK in the example) . Following is a summary of the most useful HTTP 1.1 response headers which go back to the browser from the web server. These headers are frequently used in web programming − S.No. Header & Description 1 Allow This header specifies the request methods ( GET, POST , etc.) that the server supports. 2 Cache-Control This header specifies the circumstances in w...

JSP - Implicit Objects and Client Request

JSP Objects are the Java objects that the JSP Container makes available to the developers in each page and the developer can call them directly without being explicitly declared. JSP Implicit Objects are also called  pre-defined variables . Following table lists out the nine Implicit Objects that JSP supports − S.No. Object & Description 1 request This is the  HttpServletRequest  object associated with the request. 2 response This is the  HttpServletResponse  object associated with the response to the client. 3 out This is the  PrintWriter  object used to send output to the client. 4 session This is the  HttpSession  object associated with the request. 5 application This is the  ServletContext  object associated with the application context. 6 config This is the  ServletConfig  object associated with the page. 7 pageContext This encapsulates use of server-specific features like higher performance  JspWriters . 8 p...