Getting started with the Spring MVC framework.

Let's start developing the applications using Spring MVC.

Getting started with the Spring MVC framework.

Spring MVC Getting Started - Getting started with Spring MVC


Starting the development using Spring MVC Framework

In this we will quickly start developing the application using Spring MVC module. We will also see what all configuration and code is to be developed. We we will also see how to compile, run the example program.

We will first develop a simple Spring MVC Hello World example and then test on the Tomcat server.

What is required?

In order to complete the tutorial you will need the following software and libraries.

  1. JDK 1.5 or above
  2. Eclipse IDE 3.3 or above
  3. Tomcat 6 or later
  4. Spring framework 2.5 or above

Getting stated:

Please make sure that JDK is installed on your computer. Check your Eclipse IDE version, if it is not 3.3 or above download it from the official website at Also download Spring 2.5.

Understanding the example:

We are going to develop a very simple example that will just print "Hello World" message on the browser. We will use Eclipse IDE to develop run and test the application.

We will have to follow the following steps:

  1. Create new dynamic web application in eclipse.
  2. Setup tomcat as container to run the application.
  3. Add Spring libraries to the project.
  4. Add necessary configuration in web.xml file.
  5. Create Controller class.
  6. Create dispatcher-servlet.xml and add required mapping the xml file.
  7. Create JSP file to display "Hello World" message.
  8. Finally run tomcat and deploy the application on the tomcat.
  9. And check application in web browser.

In the next section we will create new project in eclipse and add spring libraries.