Monday 9 December 2013

What is Servlet ?


  • Servlet is a server side executing program (Components).
  • Servlet is also a specification it is given part of J2EE frame work. J2EE has three specifications.
                       1.Servlet
                       2.JSP Servlet
                       3.EJB
  • Servlet and JSP Specification are given to develop web applications.
  • EJB specification is given to develop enterprise distributed application.
  • A Specification is a set of rules and guidelines for developing either a single program or Software.
  • J2EE specification (Servlets . JSP , EJB) gives rules and guidelines for developing server Software and web and enterprise applications.
  • J2EE specification is given by sun microsystem.
  • Server Software are implemented by following three specifications by different venders.
  • A test server Software is also implemented by Sun Micro System.
          Some of the well known server software

Click on image to View 
  • Java programmers as part of project development develops web and enterprise application s by following J2EE specification.
  • specification contains interface with method declarations.
                          --> These interfaces are given by sum micro systems.
                         --> These interfaces are implemented by deriving sub classes by
                                             --> Server vendars for server software development.
                                             --> By java programmer for project components development.
  • J2EE specification it is not program or software . it is a just a document file (word doc , pdf file). So we can not use it from java program as it is not available in java Syntax file.
  • It is a server vendor  responsibility to develop the specification as java .classes and interfaces compile them and should distribute to the word as work jar files.
  • Now as a project developer we must install one server software in our computer to availe j2ee-api (servlet , Jsp , EJB).classes files.
  • Then after installing server software we must set Classpath with jar file path to use J2EE specification classes from our java program.
  • If we don't set jar file in Classpath in compiling java program we will get compile time error package javax doesn't exit.
  • Java EE specification classes and interfaces are given in javax package and their implementation classes will be given in vendor specific package.
                   EX: org.apache
  • So we must import javax package in our program not vendor given package.
  • If we use vendor given package our program can not executed in another vendor given sever software.
Bellow diagram shows J2EE specification implementation with all above points

Click on image for Zoom


0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More