Servlet Tutorial

Written by Roderick Barnes

June 01, 2020

Introduction

If you are on this page it is because either (1) you are trying to get learn how to use servlets with Apache Tomcat or (2) you entered the wrong URL. In the former case BIF Technologies humbly presents what follows as a simple tutorial to get you started in the basics of web programming using Java. In the latter case, no matter where you were trying to go, the link that follows will get you what you need – click here.

The fact that you have continued reading indicates that you are here for the servlet programming tutorial. Great! The first thing you need to do is setup a Java-based web application server. Apache offers a free server named Tomcat. It is the standard for web application servers and has been in for more than twenty years. Download the compressed archive (.ZIP) for Apache Tomcat to your machine. You can get the archive from

https://tomcat.apache.org/download-90.cgi

When you have acquired the archive unpack it into a directory like the following

c:\java\apache\tomcat\apache-tomcat-9.0.35

Going forward we will refer to the directory where you unpacked Apache Tomcat as install_directory. To start the application server on Windows run the file install_directory\bin\startup.bat. If you are using Unix or a Linux flavor start the web application server using the file install_directory\bin\startup.sh. You should have the environment variable JAVA_HOME or JRE_HOME set in order to start Apache Tomcat. If the server starts normally you will see something like the following

Example 1 – Hello World Servlet

Example 2 – Using JDBC and Servlets to Generate Data Table

Example 3 – Connection Pooling and JNDI

Example 4 – Handling Parameters in the Request

Example 5 – Session Tracking

Example 6 – Securing the Server for use with CAC Cards

Example 7 – Apache Tomcat Valves

Example 8 – Apache Tomcat Filters

Example 9 – Apache Tomcat Processes

Example 10 –

Conclusion

You May Also Like…

Mind Your Business

Mind Your Business

The business intelligence solutions provided in most applications are passive. Users must come to the software’s...