Unit3Servlet API
Unit3Servlet API
Servlets API
Presented by:
Prof. Sweta Khatana Dept. of
CE Marwadi University
Contents
Servlet Introduction,
Servlet Life Cycle(SLC),
Types of Servlet,
Servlet Configuration with Deployment Descriptor,
Working with ServletContext and ServletConfig Object,
Attributes in Servlet,
Response and Redirection using Request Dispacher and using sendRedirect Method,
Filter API,
Manipulating Responses using Filter API,
Session Tracking: using Cookies,
HTTPSession,
Hidden Form Fields and URL Rewriting,
Types of Servlet Event: ContextLevel and SessionLevel
Introduction to Servlets
Servlet technology is used to create web application (resides at server side and
generates dynamic web page).
Servlets are the Java programs that run on the Java-enabled web server or application server.
They are used to handle the request obtained from the web server, process the request,
produce the response, and then send a response back to the web server.
The properties of Servlets are as follows:
Servlets work on the server side.
Servlets are capable of handling complex requests obtained from the web server.
Servlet technology is robust and scalable because of java language. Before Servlet, CGI
(Common Gateway Interface) scripting language was popular as a server-side
programming language. But there was many disadvantages of this technology.
There are many interfaces and classes in the servlet API such as Servlet, GenericServlet,
HttpServlet, ServletRequest, ServletResponse etc.
Scripting Language
Server-Side Client-Side
Scripting Language Scripting Language
PHP JavaS
ASP.NET cript
(C# VBScript
OR Visual HTML
Basic) (Structure) CSS
C++ (Designing) AJAX
Java and jQuery etc.
JSP Python
Ruby on
Rails etc
In CGI application, when a client makes a request to access dynamic Web pages, the Web server
performs the following operations:
It first locates the requested web page i.e the required CGI application using URL.
It then creates a new process to service the client’s request.
Invokes the CGI application within the process and passes the request information to the
application.
Collects the response from the CGI application.
Destroys the process, prepares the HTTP response, and sends it to the client.
Common Gateway Interface( CGI )
Disadvantages of CGI : There are many problems in CGI technology:
• For each request, it starts a process and Web server is limited to start processes.
The servlet processes the request and generates the response in the form of output.
The web server sends the response back to the client and the client browser displays it on the
screen.
Servlet Life Cycle
Servlet Container
Servlet Life Cycle
The web container maintains the life cycle of a servlet
instance.
2. Servlet instance is created: The web container creates the instance of a servlet
after loading the servlet class. The servlet instance is created only once in the servlet life
cycle.
3. init method is invoked: The web container calls the init method only once after
creating the servlet instance. The init method is used to initialize the servlet. It is the
life cycle method of the javax.servlet.Servlet interface.
4. service method is invoked: The web container calls the service method each time
when
request for the servlet is received.
5. destroy method is invoked: The web container calls the destroy method before
removing the servlet instance from the service.
Servlet Life Cycle Example
Java Servlet
1 2
4
Steps to run :Servlet Program in Netbeans
Step 1: Open Netbeans IDE, Select File -> New Project
Steps to run :Servlet Program in Netbeans
Step 2: Select Java Web -> Web Application, then click on Next
Steps to run :Servlet Program in Netbeans
Step 3: Give a name to your project and click on Next,
Steps to run :Servlet Program in Netbeans
Step 4: and then, Click Finish
Steps to run :Servlet Program in Netbeans
Step 5: The complete directory structure required for the Servlet Application will be
created automatically by the IDE.
Steps to run :Servlet Program in Netbeans
Step 6: index.html
<html>
<head>
<title>MyServlet Example</title>
</head>
<body>
<a href="MyServlet"> MyServlet</a>
</body>
</html>
Steps to run :Servlet Program in Netbeans
Step 7: To create a Servlet, open Source Package, right click on default packages -
> New -> Servlet.
Steps to run :Servlet Program in Netbeans
Step 8: Give Servlet Name.
Steps to run :Servlet Program in Netbeans
Step 9: tick the add information to deployment descriptor.
Web.xml is the
It will add servlet configuration file of
information to web applications in
web.xml file java.
Steps to run :Servlet Program in Netbeans
Step 10: open web.xml
For web applications written using the Java programming language, the web
application deployment descriptor is written using the EXtensible Markup
Language (XML) syntax. The web application deployment descriptor is
named web.xml, and, when included with a web application, it must reside in
a WEB-INF subdirectory at the web application root.
When the web server receives a request for the application, it uses the
deployment descriptor to map the URL of the request to the code that ought to
handle the request.
Deployment Descriptor
The following activities can be done by the programmer in web.xml file.
a) Mapping alias name with the actual Servlet name
• First and foremost is the alias name to the Servlet. Never a client is given the actual
name of the Servlet. Always an alias name is given just for security (avoid hacking). The
alias name is given in the following XML tags.
Copying the .class file of the Servlet from the current directory to the classes folder of
Tomcat (or any Web server) is known as deployment. When deployed, Tomcat is ready
to load and execute the Servlet, at anytime, at the client request.
• Intialization parameteres are read by the Servlet from web.xml file. Programmer can
write code to be used for initialization. An example code is given below
<init-param>
<param-name>instructor</param-name>
<param-value> John</param-value>
</init-param>
Deployment Descriptor
c) To write tag libraries (this is mostly used in frameworks like Struts etc)
An example code is given used in Struts. This we will cover later.
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
For web applications, the deployment descriptor must be called web.xml and
must
reside in the WEB-INF directory in the web application root.
For example, the web.xml file is a standard Java EE deployment descriptor, specified in
the Java Servlet specification, but the sun- web.xml file contains configuration data
specific to the Sun GlassFish Enterprise Server implementation.
The web.xml file is located in the WEB-INF directory of your Web application. The first
entry, under the root servlet element in web.xml, defines a name for the servlet and
specifies the compiled class that executes the servlet.
Deployment Descriptor: web.xml
<?xml version="1.0" encoding="UTF-8"?> xml header
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"> Document Type Definition
The mostly used approach is by extending HttpServlet because it provides http request
specific method such as doGet(), doPost(), doHead() etc.
Servlets Interface
Servlet interface provides common behaviorur to all the servlets. Servlet interface
defines methods that all servlets must implement.
Servlet interface needs to be implemented for creating any servlet (either directly or
indirectly).
It provides 3 life cycle methods that are used to initialize the servlet, to service
the requests, and to
destroy the servlet and 2 non-life cycle methods.
Servlets Interface
Method Description
public void init(ServletConfig config) initializes the servlet. It is the life cycle method of servlet
and invoked by the web container only once.
public void service(ServletRequest provides response for the incoming request. It is invoked
request,ServletResponse response) at each request by the web container.
public void destroy() is invoked only once and indicates that servlet is being
destroyed.
public ServletConfig getServletConfig() returns the object of ServletConfig.
You may create a generic servlet by inheriting the GenericServlet class and providing the
implementation of the service method.
Methods of GenericServlet
Class
There are many methods in GenericServlet class. They are as follows:
• public void init(ServletConfig config) is used to initialize the servlet.
• public void destroy() is invoked only once throughout the life cycle and indicates that
servlet is being destroyed.
• public String getServletInfo() returns information about servlet such as writer, copyright,
version etc.
• public void init() it is a convenient method for the servlet programmers, now there is no need
to call super.init(config)
Methods of GenericServlet
Class
• public ServletContext getServletContext() returns the object of ServletContext.
• public String getInitParameter(String name) returns the parameter value for the given
parameter name.
• public void log(String msg) writes the given message in the servlet log file.
• public void log(String msg,Throwable t) writes the explanatory message in the servlet log file
and a stack trace.
HTTPServlet Class
The HttpServlet class extends the GenericServlet class and implements Serializable interface. It
provides http specific methods such as doGet, doPost, doHead, doTrace etc.
Methods of HttpServlet class
• public void service(ServletRequest req,ServletResponse res) dispatches the request to the protected
service method by converting the request and response object into http type.
2) Get request is not secured because data is Post request is secured because data is not
exposed in URL bar. exposed in URL bar.
3) Get request can be bookmarked. Post request cannot be bookmarked.
</body>
Servlets Example
MyServletInterface.java public void destroy(){System.out.println("servlet is destroyed");}
import java.io.IOException; public ServletConfig getServletConfig() {return config;}
import java.io.PrintWriter; public String getServletInfo(){return "copyright 2007-1010";}
import javax.servlet.Servlet; }
import javax.servlet.ServletConfig; import
javax.servlet.ServletException; import
javax.servlet.ServletRequest; import
javax.servlet.ServletResponse;
@Override
public void service (ServletRequest req,ServletResponse res) throws
IOException,ServletException{
res.setContentType("text/html");
PrintWriter out=res.getWriter();
out.print("<html><body>");
out.print("<b>hello from service method of generic servlet</b>");
out.print("</body></html>");
}
Servlets Example
MyHTTPServlet.java
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
If the configuration information is modified from the web.xml file, we don't need to
change the servlet. So it is easier to manage the web application if any specific
content is modified from time to time.
Advantage of ServletConfig
• The core advantage of ServletConfig is that you don't need to edit the servlet file if
information is modified from the web.xml file.
ServletConfig Interface
Methods of ServletConfig interface
If any information is shared to many servlet, it is better to provide it from the web.xml
file using the <context-param> element.
Advantage of ServletContext
• Easy to maintain if any information is shared to all the servlet, it is better to make it
available for all the servlet. We provide this information from the web.xml file, so if the
information is changed, we don't need to modify the servlet. Thus it removes
maintenance problem.
Usage of ServletContext
Interface
There can be a lot of usage of ServletContext object. Some of them are as follows:
1. The object of ServletContext provides an interface between the container and servlet.
2. The ServletContextobject can be used to get configuration information from
the
web.xml file.
3. The ServletContext object can be used to set, get or remove attribute from the
web.xml file.
4. The ServletContext object can be used to provide inter-application communication.
Commonly used methods of ServletContext interface
There is given some commonly used methods of ServletContext interface.
• public String getInitParameter(String name): Returns the parameter value for the
specified parameter name.
• public void setAttribute(String name,Object object): sets the given object in the
application scope.
• public Object getAttribute(String name): Returns the attribute for the specified name.
• public void removeAttribute(String name):Removes the attribute with the given name
from the servlet context.
How to get the object of ServletContext interface
1. getServletContext() method of ServletConfig interface returns the object
of ServletContext.
We have to give the request explicitly in ServletContext object can be available even
order to create the ServletConfig object for before giving the first request
the first time
• public void removeAttribute(String name):Removes the attribute with the given name
from
Example: Attributes in Servlet
web.xml </session-config>
<web-app> <context-param>
<servlet> <param-name>org </param-name>
<servlet-name>DemoServlet1</servlet-name> <param-value>MEFGI</param-value>
<servlet-class>DemoServlet1</servlet-class> </context-param>
</servlet>
<servlet> </web-app>
<servlet-name>Servlet2</servlet-name>
<servlet-class>Servlet2</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>DemoServlet1</servlet-name>
<url-pattern>/DemoServlet1</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Servlet2</servlet-name>
<url-pattern>/Servlet2</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
Example: Attributes in Servlet
index.html
<html>
<head>
<title>Attribute Example</title>
</head>
<body>
<a href="DemoServlet1">Click Here</a>
</body>
</html>
Example: Attributes in Servlet
DemoServlet1.java
import java.io.IOException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest; import
javax.servlet.http.HttpServletResponse; public class
DemoServlet1 extends HttpServlet {
context.setAttribute("company", "Amazon");
out.println("<a href='Servlet2'>visit</a>");
out.close();
}
}
Example: Attributes in Servlet
Servlet2.java
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import
javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse;
Servlet 1
Servlet 2
Step 3:
Response
Response is
generated
Web Client
Response
RequestDispatcher: include()
Step2:
include(req, res)
Servlet 1 Servlet 2
Step3:
Response of
Servlet 2 is
included in the
Response of
Servlet 1
Response
Web Client
Response
Example : Request
Dispatcher
Example : Request
Dispatcher
Web.xml
<servlet>
<servlet-name>LoginCheckServlet</servlet-name>
<servlet-class>LoginCheckServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>WelcomeServlet</servlet-name>
<servlet-class>WelcomeServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LoginCheckServlet</servlet-name>
<url-pattern>/LoginCheckServlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>WelcomeServlet</servlet-name>
<url-pattern>/WelcomeServlet</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
Example : Request
Dispatcher
index.html
<form action="LoginCheckServlet" method=“post">
Enter Name: <input type="text" name="txtuname"/><br>
Enter Password: <input type="password" name="txtpwd"/><br>
<input type="submit" value="Login"/>
</form>
Example : Request
Dispatcher
LoginCheckServlet.java else {
import java.io.IOException;
out.println("User name or password is wrong.... Re-
import java.io.PrintWriter;
enter");
import javax.servlet.RequestDispatcher;
RequestDispatcher rd =
import javax.servlet.ServletException;
request.getRequestDispatcher("index.html");
import javax.servlet.http.HttpServlet;
rd.include(request,respons } }
import javax.servlet.http.HttpServletRequest;
e); } }
import javax.servlet.http.HttpServletResponse;
}
}
Example : Request
Dispatcher
Output
Example
response.sendRedirect("http://www.youtube.com");
It can work within the server only. It can be used within and outside the
server.
Example: Example:
request.getRequestDispacher("servlet2"). response.sendRedirect("servlet2");
forward(request,response);
SendRedirect Method in
servlet
Web.xml
<servlet>
<servlet-name>MySearcher</servlet-name>
<servlet-class>MySearcher</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MySearcher</servlet-name>
<url-pattern>/MySearcher</url-pattern>
</servlet-mapping>
Index.html
<form action=“Servlet1">
<input type="text" name="name">
<input type="submit" value="YouTube
Search">
</form>
SendRedirect Method in
servlet
MySearcher.java
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
String name=req.getParameter("name");
resp.sendRedirect("https://www.google.co.in/search?q="+name);
//resp.sendRedirect("https://www.youtube.com/results?search_query=" + name);
}
}
Filter
A filter is an object that is invoked at the preprocessing and postprocessing of a
request.
The servlet filter is pluggable, i.e. its entry is defined in the web.xml file, if we
remove the entry of filter from the web.xml file, filter will be removed automatically and
we don't need to change the servlet.
Web Container
Filter1.java
FilteredServlet.java
request Filter
request
Servlet Program
Filter response
response
WebClient
Filter
Usage of Filter
• recording all incoming requests
• logs the IP addresses of the computers from which the requests
originate
• conversion
• data compression encryption and decryption
• input validation etc.
Advantage of Filter
• Filter is pluggable.
• One filter don't have dependency onto another resource.
• Less Maintenance
Filter API
Like servlet filter have its own API. The javax.servlet package contains the
2.FilterChain Interface
3.FilterConfig
1. Filter Interface
For creating any filter, you must implement the Filter interface. Filter interface
provides the life cycle methods for a filter.
• public void init(FilterConfig config): init() method is invoked only once it is used to initialize
the filter.
</html>
Example Filter
NewServlet.java
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import
javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse;
response.setContentType("text/html");
out.println("<br>welcome to servlet<br>");
}
Example Filter
NewFilter1.java
import java.io.*;
import javax.servlet.Filter; import
javax.servlet.FilterChain; import
javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
{ @Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException,
ServletException {
PrintWriter out = response.getWriter();
}
}
Example Filter
Http protocol is a stateless so we need to maintain state using session tracking techniques.
Each time user requests to the server, server treats the request as the new request. So we
need to maintain the state of an user to recognize to particular user.
HTTP is stateless that means each request is considered as the new request.
1. Cookies
4. HttpSession
Cookies in Servlet
A cookie is a small piece of information that is persisted between the
multiple client requests.
Cookies in Servlet
A cookie has a name, a single value, and optional attributes such as a comment,
path and domain qualifiers, a maximum age, and a version number.
After that if request is sent by the user, cookie is added with request by default. Thus, we
recognize the user as the old user.
Cookies
Types of Cookie There are 2 types of cookies in servlets.
1. Non-persistent cookie
It is valid for single session only. It is removed each time when user closes the browser.2.
2. Persistent cookie
It is valid for multiple session . It is not removed each time when user closes the browser.
It is
removed only if user logout or signout.
Advantage of Cookies
• Simplest technique of maintaining the state.
• Cookies are maintained at client side.
Disadvantage of Cookies
• It will not work if cookie is disabled from the browser.
Cookies
Cookie class
Constructor Description
Cookie() constructs a cookie.
Cookie(String name, String value) constructs a cookie with
a
specified name and value.
Cookies
Useful Methods of Cookie class
Cookies can be removed by setting its expiration time to 0 or -1. If expiration time set
to 0 than cookie will be removed immediately. If expiration time set to -1 than cookie will
be removed when browser closed.
Cookies
How to get Cookies?
sample code to get all the cookies names and values.
Cookie ck[]=request.getCookies();
for(int i=0;i<ck.length;i++){
out.print("<br>"+ck[i].getName()+" "+ck[i].getValue());
}
Session Tracking Techniques
Check Program cookie
Cookie Example
Web.xml
Index.html
<servlet>
<form action=“FirstServlet" method="post">
<description>abcd</description>
Name:<input type="text"
<display-name>abcd</display-name>
name="userName"/><br/>
<servlet-name>Servlet1</servlet-name>
<input type="submit" value="go"/>
<servlet-class>FirstServlet</servlet-class>
</form>
</servlet>
<servlet>
<description>xyz</description>
<display-name>xyz</display-name>
<servlet-name>SecondServlet</servlet-name>
<servlet-class>SecondServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Servlet1</servlet-name>
<url-pattern>/servlet1</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>SecondServlet</servlet-name>
<url-pattern>/servlet2</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
Cookie Example
FirstServlet.java
import java.io.*;
import javax.servlet.http.*;
public class FirstServlet extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse
response){
try{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String n=request.getParameter("userName");
out.print("Welcome "+n);
@Override
public void doPost(HttpServletRequest request, HttpServletResponse
response){
try{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Cookie ck[]=request.getCookies();
out.print("Hello "+ck[0].getValue());
out.close();
}catch(Exception e){System.out.println(e);}
} }
Cookie Example
Hidden Form Field
In case of Hidden Form Field a hidden (invisible) textfield is used for maintaining the
state of an user.
In such case, we store the information in the hidden field and get it from another
servlet. This approach is better if we have to submit form in all the pages and we don't
want to depend on the browser.
Here, uname is the hidden field name and Ravi is the hidden field value.
Real application of hidden form field
It is widely used in comment form of a website. In such case, we store page id or
page name in the hidden field so that each page can be uniquely
identified.
Hidden Form Field
The welcome-file-list element of web-app, is used to define a list of welcome files.
Its sub element is welcome-file that is used to define the welcome file.
A welcome file is the file that is invoked automatically by the server, if you don't
specify any file name.
When the user clicks the hyperlink, the parameter name/value pairs will be passed to
the server. From a Servlet, we can use getParameter() method to obtain a parameter value.
URL Rewriting
Advantage of URL Rewriting
public HttpSession getSession():Returns the current session associated with this request, or if the request does not
have a session, creates one.
public HttpSession getSession(boolean create):Returns the current HttpSession associated with this request or, if
there is no current session and create is true, returns a new session.
<servlet>
<servlet-name>s2</servlet-name>
<servlet-class>SecondServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>s2</servlet-name>
<url-pattern>/servlet2</url-pattern>
</servlet-mapping>
</web-app>
HttpSession Example
FirstServlet.java
import java.io.*;
import javax.servlet.http.*;
HttpSession session=request.getSession();
session.setAttribute("uname",n);
public class
SecondServlet extends
HttpServlet {
public void
doGet(HttpServletRequ
est request,
HttpServletResponse
response){
try{ response.setContentType("text/html");
PrintWriter out = response.getWriter();
String n1=(String)session.getAttribute("uname");
out.println("Hi "+n1);
HttpSession Example
Servlet Event
Servlet context-level (application-level) event:
It involves resources or state related to the series of requests from one user
We can perform some operations at this event such as counting total and current logged-in users, maintaing a
log of user details such as login time, logout time etc.
If you want to perform some action at the time of deploying the web application such as creating database
connection, creating all the tables of the project etc, you need to implement ServletContextListener interface and
provide the implementation of its methods.
import javax.servlet.http.HttpSessionListener;
public class CountUserListener implements
HttpSessionListener{ ServletContext ctx=null;
static int total=0,current=0;
public void sessionCreated(HttpSessionEvent e) {
total++;
current++;
ctx=e.getSes
sion().get
ServletCo
ntext();
HttpSessionEvent & Listener Demo
First.java
out.print("<br>total users= "+t);
import java.io.IOException; import java.io.PrintWriter;
out.print("<br>current users= "+c);
import javax.servlet.*; import javax.servlet.http.*;
out.print("<br><a href='Logout'>logout</a>");
public class First extends HttpServlet {
out.close(); } }
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String n=request.getParameter("username");
out.print("Welcome "+n);
HttpSession session=request.getSession();
session.setAttribute("uname",n);
ServletContext ctx=getServletContext(); //retrieving data from ServletContext object
int t=(Integer)ctx.getAttribute("totalusers");
int c=(Integer)ctx.getAttribute("currentusers");
HttpSessionEvent & Listener Demo
Logout.java
import java.io.IOException; import java.io.PrintWriter;
import javax.servlet.*; import javax.servlet.http.*;
public class Logout extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
HttpSession session=request.getSession(false);
session.invalidate();//invalidating session
out.print("You are successfully logged out");
out.close(); }}
HttpSessionEvent & Listener Demo
Output
HttpSessionEvent & Listener Demo
Output
Find MVC in Registration Form
Mini Project
Chat Application Demo.
Create Login and Registration Form using HTTPServlet with validation and
database connection.
END OF UNIT
-3