Sun Java System Web Server 7.0 Developer's Guide to Java Web Applications

Servlet Data Flow

When a user clicks a Submit button, information entered in a display page is sent to a servlet. The servlet processes the incoming data and responds to generate content. Once the content is generated, the servlet creates a response page, usually by forwarding the content to a JSP. The response is sent back to the client, which sets up the next user interaction.

Information flows to and from the servlet according to the following high-level process:

  1. The servlet processes the client request.

  2. The servlet generates content.

  3. The servlet creates a response and either sends back directly to the client or dispatches the task to JSP or to another servlet. The servlet remains in memory, available to process another request.