Java Servlet Programing Laungage

Java Servlet Projects

Servlet Project 3

adplus-dvertising
Defining the ServletContext Interface
Previous Home Next

Define the ServletContext Interface.

The ServletContext interface defines a servlet’s view of the Web application within which the servlet is running. Using the ServletContext object, a servlet can log events, obtain URL references to resources, and set and store attributes that other servlets in the context can access.

Define Java servlets?

Java Servlets are a powerful alternative to CGI programs and scripting languages.Java servlet is a generic server extension — a Java class that can be loaded dynamically to expand the functionality of a server.

Figure-5: Show the Java Servlets model.

A java servlet is safe, efficient, portable and scalable because-

  • A java servlet is very much similar to the proprietary server extension, but except that it run inside a Java Virtual Machine( JVM) on server.
  • Unlike the CGI and FastCGI, which use multiple process to handle separate client request/ or program/ or requests, while in other case, servlets are all handled by separate threads within the web server process.
  • Due to servlet run within the Web server, they can interact very closely or controlled by Java Beans with the server, such things not possible into CGI scripts.
  • Java servlet is platform independent as much as java.
Previous Home Next