View RSS Feed

HTTP

HTTP for Servlets

  1. Reading Request Headers from Servlets

    by , 11-28-2011 at 06:31 PM
    It is relatively easy to read headers. All you need to do is call the getHeader method of HttpServletRequest. If the specified header exists, the servlet returns a String, if not the servlet will return null. Unlike parameter names, header names are not case sensitive. Although getHeader is a general-purpose way to read incoming headers, there are a couple of headers that are so commonly used that they have special access methods in HttpServletRequest. They are listed below.
    • getCookies
    ...
  2. Notes on Form Data for Servlets

    by , 11-28-2011 at 06:25 PM
    When you look at the URL in your web browser if you are using a search engine or on a retail site, you will notice URLs http://host/path?user=James+Rogers&s...rish&sub=music. The part after the question mark (i.e., user=James+Rogers&subj= folk&sub=irish&sub=music) is known as form or query data and is the most common way to get information from a Web page to a server-side program. Form or query data can be attached to the end of the URL after a question mark, for ...
    Categories
    URL Mapping , Form , Tutorial , HTTP
  3. How to Debug Servlets

    by , 11-28-2011 at 06:07 PM
    Servlets can be difficult to debug because it is not possible to execute them directly. Instead, you trigger their execution by means of an HTTP request, and they are executed by the Web server. For remote execution, inserting break points or reading debugging messages and the stack traces becomes extremely difficult. Here I will outline some strategies to servlet debugging:
    1. Check the HTML source. If it doesn’t look correct, use the “View Source” command in order to check the HTML. If
    ...
    Categories
    Tutorial , HTTP
  4. Know the Servlet Life Cycle

    by , 11-28-2011 at 06:04 PM
    If you are programming in java on the back end, one of the key enabling technologies that you must know is servlets. Basically a servlet is a class that handles HTTP responses and makes HTTP Requests. I’m going to assume that you know enough about servlets to be able to override doGet and doPost in order to do some useful work (generate HTML) with your servlets, but what you might not know is the servlet lifecycle. I outline this below in order to improve your understanding how servlets work and ...
    Categories
    Tutorial , HTTP