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.
- JDK 1.5 or above
- Eclipse IDE 3.3 or above
- Tomcat 6 or later
- Spring framework 2.5 or above
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 http://www.eclipse.org/downloads/. 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:
- Create new dynamic web application in eclipse.
- Setup tomcat as container to run the application.
- Add Spring libraries to the project.
- Add necessary configuration in web.xml file.
- Create Controller class.
- Create dispatcher-servlet.xml and add required mapping the xml file.
- Create JSP file to display "Hello World" message.
- Finally run tomcat and deploy the application on the tomcat.
- And check application in web browser.
In the next section we will create new project in eclipse and add spring libraries.