View RSS Feed

Recent Blogs Posts

  1. HTTP Sessions

    by , 01-01-2012 at 04:50 PM
    One of the recommended approaches is HTTP session. A request is being identified by the session which is originated from similar browser during the conversation time period. Same session could be shared by all servlets. The JSESSIONID gets generated by server and is passed via cookies to the client, Built in SSL mechanism or URL rewriting (if cookies get off). For minimizing the object’s size stored in session, care shall be taken. To obtain the session in Java servlet proceed as following:
    ...

    Updated 01-15-2012 at 08:35 AM by Servlet

    Categories
    Session
  2. How to send HTTP request to a URL

    by , 12-09-2011 at 08:28 AM
    Sometimes an application needs to communicate to a web server to send/receive data through HTTP. For example, connecting to a financial service to get stock price, posting user data to server to save in database, or checking for a new version of an application if available.

    This article will guide you to write a generic utility method that can connect to a specified URL with either HTTP’s GET/POST method, and attaching parameters to the request. The method will return server’s response ...
    Tags: http, java, post, request, url Add / Edit Tags
    Categories
    HTTP , URL
  3. How to Debug Servlets

    by , 11-28-2011 at 07: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
    HTTP , Tutorial
  4. Know the Servlet Life Cycle

    by , 11-28-2011 at 07: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