SEO Home » Programming Services In JAVA » Servlet usage

Servlet usage

To make Servlet usage easy Sun has made publicly available a set of classes that provide basic servlet report. The javax.servlets and javax.servlets.http packages constitute this servlet API. In addition to servlet classes you need servlet engine.

Servlet engine (Servlet Container)

Servlet interface to a particular server architecture through a set of standard interface called
Servlet Engine(to run servlets we just can use any web server ,since servlets can be run using a standalone servlet engine the web server doesn’t need to support servlet).

This container translates requests from whatever protocol is being used in to objects that servlets understand
Also gives the servlet an object that can be used to send a response
The container is also responsible for managing the Life Cycle of the servlet.

There are three flavors of Servlet Engines

Stand-Alone Servlet Engines
Add-on Servlet Engines
Embeddable Servlet Engines

A stand-alone engine is the server that includes build-in support for servlets. Such an engine has the advantage that every thing works right out of the box. Some famous servers are Java Web server, Jigsaw server, Netscape Enterprise server, JSWDK (java server web development kit).

The Add-on servlet engine functions has plug-ins to the existing server, it adds servlet support to the server that was not originally designed keeping servlets in mind. Some famous servlets are Java Apache Server, Live Software’s JRun server, and IBM Websphere.

An embedded engine is generally a light weight server deployment platform that can be embedded in another application. Some of the famous webservers are Java server, Jef PosKanzer’s Acme server, and Paralogic’s webcore.

Life Cycle of a Servlet

The Servlet container creates an instance of the Servlet
The container calls the created instance’s Init() method.
If the container has a request for the servlet ,the instance’s service() method is called.
Before destroying the Instance , the container calls the destroy() method.
The instance is destroyed and marked for garbage collection.
There is nothing to stop a servlet container from performing the entire servlet lifecycle each time a servlet is requested.

For more information on Search Engine Genie’s services, contact us at webpromotions@gmail.com

 

 

 

Search Engine Optimization Services