Developing JSP's and Servlets

Looking for a desktop environment to develop and test commercial-quality Java code, JSP's and Servlets? Prefer not to spend a small fortune for the software?

Here's a great alternative to high-priced, commercial software and you just can't beat the price! It's all either free and open source (or just free) and available for downloading on the internet (for commercial work or for provider support, some of the components may have a price tag). After it's set up you'll be able to make changes to your JSP's and servlets and see the effects immediately in a browser. You'll also have many of the debugging features of the Eclipse environment available and the console will be live along with the Tomcat logs for bug tracing.

You can develop WAR files (Java Web Archive files) which can be dropped into the webapps folder of a Tomcat server. Tomcat will magically “explode” the WAR file into the appropriate folders. This makes transferring your website to a server a snap. If you select the option to include the Java files you can also pass your WAR file to other developers who can unzip the WAR into a project inside Eclipse for further development.

This tutorial covers the basics of a JSP and Servlet development environment. It is recommended you learn these basics before moving on to Struts, Tiles, Validation and other advanced frameworks.

The following pages include the steps to load Java, a Tomcat JSP container which works as a server, the Eclipse IDE, and a MySQL database server. The versions are generally up-to-date as of May, 2012. Other versions may be available but remember to read through the various websites to confirm all the components will work together. After the downloads are unzipped, installed and set up you will have eaten 500+ mb's on your hard drive. Even more as you begin to set up the workspaces and databases for development -- plan on a gigabyte of hard-drive space.

The programs were installed on a workstation running Windows 7 in 64-bit mode. The setup is essentially the same for XP, Vista and Windows 7 in 32-bit. If you download the 32-bit versions of the following programs remember to install the programs in C:\Program Files(x86)\ rather than C:\Program Files\. Some of the screen captures were made in Windows Classic mode -- they look old-fashion but are a little easier to read.

Component Version Link Download Size (Zipped) Installed Size
Java 7 JDK 7.4 http://www.oracle.com/technetwork/java/javase/downloads/index.html 95 mb 204 mb
Tomcat 7.0.23 http://tomcat.apache.org/download-70.cgi 8.3 mb 13.4 mb
Eclipse (Indigo) 3.7.1 www.eclipse.org/downloads/index.php 212 mb 283 mb
MySQL 5.1.53 dev.mysql.com/downloads/mysql/5.5.html 32 mb 78 mb
MySQL Connector 5.1.18 dev.mysql.com/downloads/connector/j/5.1.html 4 mb 9 mb
MySQL Workbench
(not required but highly recommended)
5.0 "http://dev.mysql.com/downloads/gui-tools/5.0.html" 26 mb 97 mb
Setting up projects   Start coding!    
Project testing from the workspace   Hot-swapping your code.    
Creating a WAR file   Exporting your project.    
Book Recommendations   Using the Amazon links on the left help support this page.    



Contact:

Please send any comments or suggestions to webmaster@sipages.com. It would be a huge help if you report errors in the instructions or just point out hard-to-understand sections. Several hundred Java/Tomcat beginners are using these instructions every day -- so any corrections would help us all.

The Murach book, “Java Servlets & JSP (2nd Edition),” is highly recommended for developers learning the basics of JSP's and servlets. It will help you develop a strong foundation before venturing into Struts, Tiles, Validation, etc. The Hall, Brown, and Chaikin book, “Core Servlets and JavaServer Pages, Vol. 2 (2nd Edition),” is excellent and includes the Struts, Tiles and Validation frameworks. Both are readable by beginners. There are Amazon links to both books on the left column of this page. Using these Amazon links help pay for this site -- thank you very much.

This page was last updated December, 2010. The screen captures are from a Windows 7 computer and may differ slightly from other operating systems. Some captures may also indicate earlier application versions, i.e., C:\Program Files\Java\jdk1.6.0_01 whereas the current version might be C:\Program Files\Java\jdk1.6.0_23.