Servlet Introduction:

Introduction:

    Servlet is a Serverside Programming And It Is Runs on Server .And It is A Simple Java Program That Extends Http Servlet Class Which Exist In The Servlet API(Available Servlet Api.Jar). And Servlet Class Should be Public. Servlet Is A Part Of Middleware To Build An Application. Also For Build Webapplications.

What is The Servlet:

    Servlet Is a Serverside Programming To Build Webapplications.
Servlet Achitecture:
Servlet Achitecture
    Briefly explain figure in bellow.
  • Client sends request then browser creates http request and sends to server to appropriate one based on port number(like8080)
  • then server send the client request to the container.
  • query formation
  • query fire and run.
  • servlet container sends the response back dynamic content to the client(browser).
  • browser will converts(renders) that html response to human readable formate.

How Servlet will work:

    Steps:
  • 1. First servlet class will be loaded
  • 2. Then servlet class to be instantiated.
  • 3. Then Init() method invoked.
  • 4. Then service method invoked.
  • 5. Finally call the destroy method.
Servlet working flow

Why servlets:

  • 1. Servlet is a part of middleware to build an application.
  • 2. Servlet behaving like mediator between client and database.
  • 3. Servlet are also used to generating dynamic content to web servers.
  • 4. Servlets generate HTML webpages dynamically by taking inputs.
HTML Comment Box is loading comments...