Servlets Tutorials

SHARE & COMMENT :

Servlet is Java technology for writing the server side applications. It is the core technology used for developing any Java server applications. Any other Java frameworks created are internally using the servlet for hiding the complex part of how servlet handles the web application request and renders the response. However, knowing the internals of servlet technology is more important to understand the Java web frameworks. This post updated with comprehensive list of servet tutorials for the beginners and advanced developers.

Latest servlets version is 3.1. The following are the key features introduced in the 3.1 release. It is part of Java EE 7 package.

  1. Non-blocking IO APIs. Servlet 3.0 introduced the Asynchronous IO operations, how ever it doesn’t guarantee the blocking of IO operations which may reduce the performance. 3.1 introduces the event listeners to notify the IO blocking.
  2. HTTP protocol upgrade mechanism.
  3. Security enhancements.

Servlet API History

Servlet API VersionDateJava EE / JDKFeatures / Changes
Servlet 3.1May 2013JavaEE 7Non-blocking I/O, HTTP protocol upgrade mechanism
Servlet 3.0December 2009JavaEE 6, JavaSE 6Pluggability, Ease of development, Async Servlet, Security, File Uploading
Servlet 2.5September 2005JavaEE 5, JavaSE 5Requires JavaSE 5, supports annotation
Servlet 2.4November 2003J2EE 1.4, J2SE 1.3web.xml uses XML Schema
Servlet 2.3August 2001J2EE 1.3, J2SE 1.2Addition of Filter
Servlet 2.2August 1999J2EE 1.2, J2SE 1.2Becomes part of J2EE, introduced independent web applications in .war files
Servlet 2.1November 1998UnspecifiedFirst official specification, added RequestDispatcherServletContext
Servlet 2.0JDK 1.1Part of Java Servlet Development Kit 2.0
Servlet 1.0June 1997

Servlets Basic Tutorials

  • Introduction to Servlet : Servlets are an important component of a J2EE application. Servlets along with JavaServer Pages (JSP) and EJB modules can be termed as server-side J2EE component types. Servlet is a Java Programming Language.
  • Servlet API : This tutorial lists the important Servlet API and provides the brief description about each API.
  • Servlet LifeCycle : Lifecycle of the servlet instance. It explains the init, service and destroy methods with examples.
  • Servlet Example : This is the first hello world servlet with easy to understand explanation.
  • Web.xml : Deployment descriptor, a core component for web application is explained in this tutorial.
  • Servlet Context : How to use the servlet context and initialize it. A nice tutorials with examples.
  • Request Dispatcher In Servlet : How to use Request Dispatcher and the important methods in it. Read this post for simple examples about the page navigation using request dispatcher and simple explanation.
  • sendRedirect in Servlet : SendRedirect method invokes the new request from the client side instead of doing the redirect from the server side, this has few advantages over the forward method defined in the RequestDispatcher object. Read this article for examples.
  • ServletConfig in Servlet : ServletConfig is important for initializing and passing the servlet specific parameters to the class. This values are directly accessed in the init method of the servlet class. Developer can initialize the param in the web.xml.
  • Difference Between Servlet and JSP  : A decade old debate of JSP and Servlet differences. We again lists the known differences which could be useful for the beginners who are new to these technologies.
  • MVC Architecture Using Servlet And JSP : Model – View – Controller (MVC) architecture using the JSP and Servlet technologies. Before the arrival of MVC frameworks, these techniques are widely used for achieving the MVC design.
  • SingleThreadModel In Servlet : Currently it is deprecated and not used by the developers, this API useful for enforcing the threads to execute in the single thread. It is very rarely used by any developer since it would impact the performance.
  • HTTP Status Codes : Server returns the status codes with the response. These codes indicate the result of the request. There are number of status codes with the different meaning. These are very common across any web applications. This post lists down the status codes with its meaning.
  • How To Initialize Variables In Servlet : The variables in the servlets are initialized in the init() method of the servlet. These variables can be used in the service() method or doGet() or doPost() methods.
  • Servlet Filter : Servlet Filters are one of the important aspect for filtering the request parameters and customize the request. This is very often used in monitoring the request.
  • Cookies In Servlet : One of the session tracking technique is using cookies. Read this tutorial for knowing the example code.

Servlets 3.0 Tutorials

The latest major version of the servlet specification is Servlets 3.0. The following are tutorials related to the latest version.

  • Asynchronous Servlets in Servlets 3 : It is one of the key feature with the latest version. Servlets can work Asynchronously without waiting for the response. This will help us to design more advanced web applications using the servlet itself.

Other Servlet Tutorials

Comments

comments

About Krishna Srinivasan

He is Founder and Chief Editor of JavaBeat. He has more than 8+ years of experience on developing Web applications. He writes about Spring, DOJO, JSF, Hibernate and many other emerging technologies in this blog.

Speak Your Mind

*

Close
Please support the site
By clicking any of these buttons you help our site to get better