Likes

WCD -LAB @HOME 1-Ans 2

Section : Introduction to Java Servlets ( 2 of 2 )2. Create a Web application that displays the message, Welcome to Java Servlets, when executed, as shown in the following figure.



                                      java servlets
*A java servlet is similar to a CGI program,which responds to HTTP requst and scr runs
 on the web server.
* The servlet runs as a thresd in the web container instead of a separate os process.
*THe web conainer itself is os process.but it runs s a service and is avilavble continuausly
  in contrastto the CGIscript,which creates new prcess for each request .
*when the number of rquests for a servlet rises,on additional instances of the servlet or as
  process are created.
*Each request is process concurrently using one java thread per rquest.
   
                       INTRODUCING A WEB CONTAINER
*A web container is a runtime enviroment that manages the components,such as servlets,
 java server pages(JSP)page,filtes,web event listenersof theweb application.
*the following features are provided by the web container to all web application:-
  (1)communciton support
(2)life cyclemanagement
(3)Multithreading support
(4)declarative securty
(5)JSPSupport

                        ADVANCTAGE AND DISADVANtge of java servlets
*The advantageof servlest are:-
(1)servletrequest processing is faster thanCGIprocessing because each request
  is run in a separate thread within a single process.
(2)servlet are more scalable thanCGI because more requests can be executed because the
   web cantainer user a thread rther than n os process.
(3)servlet benefit from the simple,robust,paltfrome-independent and object-
oriented nature of the jv programming language.
(4)servlets hava access to standardize and easy-to-use logging capablities.
(5)the webcontainer provides additional services to the servlets,such handling and security.
   
                           the disavantage of servlets
*servlets can only be written in the java programming languge,so developers are requesr to be
  competentwith this language.
*servlets might introduce new cancurrency issues not found in CGI.

No comments: