Building an entire Java web application with MyBatis 3, Tomcat, MySQL and Eclipse (on Windows 7)
This is a multi part tutorial which will show you how to build a Servlet/JSP based web application from scratch, using MySQL, Tomcat and MyBatis (the new version of the iBatis framework) on a windows platform using Eclipse.
You will make the most of this tutorial if
- You have built at least a few small webapplications in the past.
- You know how to setup Tomcat 5.x or higher version
- You are somewhat familiar with the Eclipse IDE
- You are familiar with SQL.
- You know how to set-up MySQL on your development box and integrate it with your java web application.
Let's get started
To see how Tomcat, MyBatis and MySQL work together we're going to create a tiny java web application in Eclipse, called ModelingAgency.
If you don't want to follow the whole tutorial, you can skip through to the different sections below and pick out the information you need, otherwise continue to Part 1 - The Setup
Table of Contents
- Part 1: The Setup
- Part 2: The ModelingAgency Application
- Part 3: Creating the ModelingAgency project in Eclipse
- Part 4: Creating a Test Servlet
- Part 5: Setting up Logging
- Part 6: The Java POJO model
- Part 7: Configuring MyBatis
- Part 8: Testing MyBatis with jUnit
- Part 9: Creating the DAO Layer
- Part 10: Initializing MyBatis on Application Startup
- Part 11: Finalizing the Interface
At the end of this tutorial you will hopefully be able to create a basic Java JSP/Servlet based webapp with MyBatis, MySQL and Tomcat in an Eclipse environment.
You can download a full version of finished ModelingAgency webapp here.
This tutorial took me a long time to write, so if you found it useful in any way, if you found errors with it or you think something is missing, please let me know and I will do my best to improve it.