A very simple Servlet example

This step by step Servlet tutorial provides a very simple servlet example for beginners.

The tutorial covers:

  1. How to write the servlet class.
  2. How to compile the Servlet class.
  3. How to extract the HTML form parameters from HttpServletRequest.
  4. web.xml deployment descriptor file.
  5. How to create the war (web application archive) file.
  6. How to deploy and run the sample web application in tomcat web container

J2EE web development tutorials

Step by step tutorials on web development using J2EE platform.This series of Servlet tutorials provide the learning material for begineers and intermediate J2EE developers.These are the basic Servlet tutorials which provide foundation for other Servlet and JSP tutorials.

Prevent caching of JSP/Servlet output

This example explains how to prevent browser from caching Servlet/JSP output.

Forwarding request to Servlet or JSP

This servlet example explains how to forward request to a Servlet or JSP.

response.sendRedirect() - Redirect to another Servlet or JSP

This example shows how to redirect to another URL from a servlet.

The JSP page directive

JSP tutorial: This tutorial explains JSP page directive in detail.

Introduction to Java Server Pages

This tutorial provides brief introduction to Java Server Pages (JSP) technology.

Understanding the GenericServlet class

GenericServlet defines a generic protocol independent Servlet. GenericServlet class is the base class of HttpServlet class.

This tutorial covers following topics.

  1. How to write your own servlets that extends GenericServlet. 
  2. How to initialize the servlet by overriding init() method.
  3. How to handle requests by overriding service() method
  4. Override the destroy() method.
  5. How to access servlet intialization parameters using ServletConfig object.
  6. How to write the log to server log file.

Applet Servlet Communication Example

This tutorial explains how to send data to a servlet from an applet and receive response. Concept explained in this tutorial can also be used for applet jsp communication.

Servlet File Upload Example

This servlet file upload tutorial explains how to upload files using apache commons file upload API.

Setting up a Servlet development environment

This tutorial explains how to setup the development environment to compile, develope and deploy servlets and Java server pages (JSP).

This tutorial covers following topics
  1. How to install Java SDK on windows platform.
  2. How to install Tomcat web container on windows platform.
  3. How to set the JAVA_HOME, Path and CLASSPATH environment variables.
  4. How to start and shut down the tomcat server.

Overview of Servlet API Classes and Interfaces

This tutorial provides brief explanation of classes and interfaces of Servlet API, focusing particularly on the javax.servlet package.

The Life Cycle of a Servlet

This tutorial explains the Servlet life cycle.

Introduction to Java Servlets

This tutorial gives basic introduction to Java Servlets.

Understanding the structure of web applications

Servlet specification defines the directory structure for deployment and packaging of web applications. When developing web applications with Servlets and JSP you must follow the directory structure. This tutorial explains how to organize the directory structure. where to put the compiled servlet classes and jar files.
Syndicate content