Servlet Video Tutorial

Servlet Part-1

 

Video features the following
  • Servlet Definition and functionality
  • Introduction to CGI (before Servlet)
  • Limitation of CGI
  • Advantages of Servlet
Servlet Part-2
Video features the following
  • Servlet Architecture
  • Packages of Servlet
  • Generic Servlet
  • Http Servlet
  • HTTP Response-Request Model
  • Tomcat Container
  • Servlet Implementation
Servlet Part-3

 

Video features the following
Practical Implementation of Servlet using GenericServlet Class
Step to Create Servlet using GenericServlet Class
1. Apache Tomcat configuration in Eclipse for web projects
2. Creating Dynamic web project
3. Add java class that extends the GenericServlet class (in new class wizard)
Java EE Installation

 

Installing Eclipse for Java Enterprise Edition.  
Configuring Apache Tomcat Server with Eclipse. Demo Application to test Dynamic Web application. 
Using Index page and a generic servlet to handle the request made my index page.
Servlet Part-5
Define servlet using 
  (1) Servlet Interface 
  (2) HTTP Servlet class
Static Login (without db)  Example using HTTP servlet
Using HTTP Request object to retrieve parameter values
Servlet Part-6
Arithmetic Operations of two numbers using Servlet. 
- index.html (client side : user interface to accept the input from user)
- airth.java (server side : servlet to process request made by user to perform arithmetic operation on two number)
Servlet Part-7

Deployment descriptor file which is also known as web.xml file, is used to configure the web app as well as servlet. 

It is most important while the web app is to be deployed on the server, for example the database connection is going to differ while you deploy the app on server, so its preferable to define such settings in web.xml file because its a tag file which can be easily editable in any editor. 

If we define the such settings in java file they need to be edited and re-compile on server, which is not feasible.
Servlet Part-8

Servlet Context parameters are application wide parameter (such as global variables) accessible through out web application, any servlet or Jsp page can access these parameters, and there is only one copy of such parameters per web app. These parameters are to be configured in web.xml file in java web application. 

Servlet config parameters are specific to the servlet for which is declared, it is local for that servlet. These parameters are private to each servlet. These parameters are also configured in web.xml (inside servlet tag).
Servlet Part-9
A request object of servlet consist the client information , such as client header information 
and client input parameters. 

Here, Enumeration is used to read the values of client headers (list of headers) and to read the values of parameters (list of input parameters).
Servlet Part-10

Demonstration of HttpRequest object methods, such as 
  • getRemoteAddr(), 
  • getRemoteHost(), 
  • getQueryString(), 
  • setAttribute(), 
  • getAttribute(), 
  • getAttributeNames(). 
Servlet Part-11 | Redirection in Servlet (Gujarati)


Servlet Redirection :
- Local resource like servlet, jsp or html page etc.
- Resource outside of our domain/application
- Example of searching Google from out application

Servlet Redirection can be used to transfer/forward control to Local resource like servlet, jsp or html page etc., It can also used to transfer/forward the Resource outside of our domain/application. Here there is an example to transfer request from one servlet to anohter servlet when client request the first servlet. This example also demonstrate how it refers the another html page for redirection. And finally this example also demonstrate a trick to search Google directly from our application.
Servlet Part-12 | Servlet Collaboration (Gujarati)


Some times servlets have to cooperate, i.e. usually by sharing information.
This communication can be called as Sort Servlet collaboration. 
The servlet, which are collaborating, can pass the shared information directly from one servlet to another. Request Dispatcher defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server. The servlet container creates the RequestDispatcher object, which is used as a wrapper around a server resource located at a particular path or given by a particular name.
Servlet Part-13 | Single Thread Model (Gujarati)


Single Thread Model:
It was designed to guarantee that only one thread is executed at a time in a given servlet instance’s service method. 
It should be implemented to ensure that servlet can handle only one request at a time.

It is a marker interface and has no methods.
This interface is currently deprecated.
Once the interface is implemented the system guarantees that there’s never more than one request thread accessing a single instance of servlet.














No comments:

Post a Comment

Recent Post

Launching of my new Domain

RaviROza.com