WELCOME
Seminar
topic is
Java Servelets
CONTENTS:
ď‚— Introduction
ď‚— History
ď‚— What is servelets?
ď‚— How is used servelets?
ď‚— Life cycle of servelet
ď‚— Architecture of servelets
ď‚— Advantages
ď‚— Disadvantages
ď‚— Conclusion
HISTORY
ď‚— The Servlet1 specification was created by Pavni
Diwanji while she worked at Sun Microsystems ,
with version 1.0 finalized in June 1997
ď‚— Starting with version 2.3, the specification was
developed under the Java Community Process.
INTRODUCTION TO JAVA SERVELETS
ď‚— Servelet technology is used java language
to create web applications.
ď‚— web applications are helper applications
that resides at web server and build
dynamic pages.
ď‚— As Servelet Technology uses Java, web
applications made using Servelet
are Secured Scalable and Robust.
What is servelets?
ď‚— The servelet is a java programming language that
extends the capabilities of server.
ď‚— Servelets can respons to any type of request they are
commonly used to extend the applications by web
server.
ď‚— , Java Servlet technology defines HTTP-specific servlet
classes.
ď‚— The javax.servlet and javax.servlet.http packages provide
interfaces and classes for writing servlets.
How used servelets?
ď‚— It is important to learn how servlet works for
understanding the servlet
ď‚— The server checks if the servlet is requested for the
first time.
ď‚— If yes, web container does the following tasks:
ď‚— loads the servlet class.
ď‚— instantiates the servlet class.
ď‚— calls the init method passing the ServletConfig object
ď‚— else,calls the service method passing request and
response objects
Life cycle of Servelets
A servelet life cycle can be defined as the entire process from
its creation till the destruction.
The following are the paths followed by a servlet.
ď‚— The servelet is initialized by calling the init () method
ď‚— The servelet calls service() method to process a client's request.
ď‚— The servelet is terminated by calling the destroy()method
The init() method
ď‚— The init method is designed to be called only once. It
is called when the servlet is first created, and not
called again for each user request.
ď‚— The servlet is normally created when a user first
invokes a URL corresponding to the servlet.
The init method definition looks like this:
public void init() throws
ServletException
{ // Initialization code...}
The service() method
ď‚— The service() method is the main method to perform
the actual task. The servlet container (i.e. web server)
calls the service() method to handle requests coming
from the client( browsers) and to write the formatted
response back.
public void doPost(HttpServletRequest request,
HttpServletResponse response) throws
ServletException, IOException { // Servlet code}
ď‚—
The destroy ()method:
The destroy() method is called only once at the
end of the life cycle of a servlet. This method gives
Then the servlet container handles multiple requests
by spawning multiple threads, each thread executing
the service() method of a single instance of the servlet.
Architecture of Servelets
ď‚— First the HTTP requests coming to the
server are delegated to the servlet container.
The following figure depicts a typical servlet
life-cycle scenario.
Advantages
ď‚— Servlets provide a way to generate dynamic
documents that is both easier to write and faster to
run.
ď‚— provide all the powerfull features of JAVA, such as
Exception handling and garbage collection.
ď‚— Servlet enables easy portability across Web Servers.
ď‚— Servlet can communicate with different servlet and
servers.
Disadvantages
ď‚— Designing in servlet is difficult and slows down the
application.
ď‚— Writing complex business logic makes the
application difficult to understand.
ď‚— You need a Java Runtime Environment on the server
to run servlets. CGI is a completely language
independent protocol.
Conclusion
Security is an important aspect of applications
that transport sensitive data over the Internet. Because
of this requirement, the servlet specification requires
servlet containers to provide implementations of basic
and digest authentication, as defined in the HTTP/1.1
specification. Additionally, servlet containers must
provide form-based security that allows developers to
control the look and feel of login screens.
THANK YOU

J servlets

  • 1.
  • 2.
  • 3.
    CONTENTS: ď‚— Introduction ď‚— History ď‚—What is servelets? ď‚— How is used servelets? ď‚— Life cycle of servelet ď‚— Architecture of servelets ď‚— Advantages ď‚— Disadvantages ď‚— Conclusion
  • 4.
    HISTORY ď‚— The Servlet1specification was created by Pavni Diwanji while she worked at Sun Microsystems , with version 1.0 finalized in June 1997 ď‚— Starting with version 2.3, the specification was developed under the Java Community Process.
  • 5.
    INTRODUCTION TO JAVASERVELETS ď‚— Servelet technology is used java language to create web applications. ď‚— web applications are helper applications that resides at web server and build dynamic pages. ď‚— As Servelet Technology uses Java, web applications made using Servelet are Secured Scalable and Robust.
  • 7.
    What is servelets? ď‚—The servelet is a java programming language that extends the capabilities of server. ď‚— Servelets can respons to any type of request they are commonly used to extend the applications by web server. ď‚— , Java Servlet technology defines HTTP-specific servlet classes. ď‚— The javax.servlet and javax.servlet.http packages provide interfaces and classes for writing servlets.
  • 8.
    How used servelets? ď‚—It is important to learn how servlet works for understanding the servlet ď‚— The server checks if the servlet is requested for the first time. ď‚— If yes, web container does the following tasks: ď‚— loads the servlet class. ď‚— instantiates the servlet class. ď‚— calls the init method passing the ServletConfig object ď‚— else,calls the service method passing request and response objects
  • 9.
    Life cycle ofServelets A servelet life cycle can be defined as the entire process from its creation till the destruction. The following are the paths followed by a servlet. ď‚— The servelet is initialized by calling the init () method ď‚— The servelet calls service() method to process a client's request. ď‚— The servelet is terminated by calling the destroy()method
  • 10.
    The init() method ď‚—The init method is designed to be called only once. It is called when the servlet is first created, and not called again for each user request. ď‚— The servlet is normally created when a user first invokes a URL corresponding to the servlet. The init method definition looks like this: public void init() throws ServletException { // Initialization code...}
  • 11.
    The service() method ď‚—The service() method is the main method to perform the actual task. The servlet container (i.e. web server) calls the service() method to handle requests coming from the client( browsers) and to write the formatted response back. public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // Servlet code} ď‚—
  • 12.
    The destroy ()method: Thedestroy() method is called only once at the end of the life cycle of a servlet. This method gives Then the servlet container handles multiple requests by spawning multiple threads, each thread executing the service() method of a single instance of the servlet.
  • 13.
    Architecture of Servelets ď‚—First the HTTP requests coming to the server are delegated to the servlet container. The following figure depicts a typical servlet life-cycle scenario.
  • 15.
    Advantages ď‚— Servlets providea way to generate dynamic documents that is both easier to write and faster to run. ď‚— provide all the powerfull features of JAVA, such as Exception handling and garbage collection. ď‚— Servlet enables easy portability across Web Servers. ď‚— Servlet can communicate with different servlet and servers.
  • 16.
    Disadvantages ď‚— Designing inservlet is difficult and slows down the application. ď‚— Writing complex business logic makes the application difficult to understand. ď‚— You need a Java Runtime Environment on the server to run servlets. CGI is a completely language independent protocol.
  • 17.
    Conclusion Security is animportant aspect of applications that transport sensitive data over the Internet. Because of this requirement, the servlet specification requires servlet containers to provide implementations of basic and digest authentication, as defined in the HTTP/1.1 specification. Additionally, servlet containers must provide form-based security that allows developers to control the look and feel of login screens.
  • 18.