What is servlet?

1.A servlet is server side software program that dynamically extends functionality of a web page in web server to its client.

2.Servlet creates dynamic and interactive web pages that can be stored in a server (web server) and can be accessed securely.

3.This the technology that that creates content of basically HTML web page dynamically as when required as per users request.

4.Servlets are java class files associated with specific interface creates dynamic HTML codes for the user and can be invoked via a web server.

5.The servlets reside within the web server in which a servlet container contains the servlets.

6.Web servers are able to execute servlets and produces dynamic HTML after getting request from the users.

7.For each user the servlet is instantiated by using concept of threading without creating copy of that page. Servlet is a single instance multi threaded model.

8.Some other technologies that create dynamic pages are: JSP, ASP, PhP, Cold Fusion etc.

9.Since the Servlet runs at server side so it does not checks the browser for compatibility.

10.Servlets provide component-based, platform-independent methods for building Web-based applications, without the performance limitations of CGI programs.

11.Servlets can access the entire family of Java APIs, including the JDBC API to access enterprise databases.

12.Today servlets are the popular choice for building interactive web application.

13.Servlets are not designed for a specific protocols.


In case of java Servlets, for each request from client a thread of the servlet is created. The JVM continues to run in the server to accept the request and making threads. Does not use the heavy weight processes.

Java servlets are portable across the OS and server implantations. We can write servlets for Tomcat server in Windows platform and can deploy the same in UNIX platform with another web server with no effort or little effort.

Servlets exploit the power and efficiency of core java, networking, multithreading, database connectivity, serialization, RMI. It also takes the advantages of EJB, JNDI, and Messaging Services of the J2EE platform.

Safeties comes from the Java’s features of strongly typed, no use of pointer.
Java’s exception handling handles the errors.
Server also protects itself from servlets through Java Security Manager that access the control by defining policy.

Servlets APIs are designed to be easily extensible for further enhancement.

One, who knows Java, need not know other language for server side programming.
Most of the things are automatic: passing parameter, reading HTML form, handling cookies etc.

No comments:

Post a Comment