Monday, November 24, 2008

How will the Servlet Work??


A servlet is loaded by the servlet container the first time the servlet is requested. The servlet then forwards the user request, processes it, and returns the response to the servlet container, which in turn sends the response back to the user. After that, the servlet stays in memory waiting for other requests—it will not be unloaded from the memory unless the servlet container sees a shortage of memory. Each time the servlet is requested, however, the servlet container compares the timestamp of the loaded servlet with the servlet class file. If the class file timestamp is more recent, the servlet is reloaded into memory. The main steps are illustrated by the flowchart above.

No comments: