Creating a basic Spring MVC project was a difficult thing for beginners because it involves so many steps from configuring all spring dependencies to deploying into some server. But once Spring Tool Suite introduced, creating a Spring MVC application has become a very simple process. In this post we are going to see how to create Spring MVC application using Spring Tool Suite within a minute.
Before going to start first let me tell you what are all the Pre-requisite software or jars which is required to develop the Spring MVC.
- Spring Tool Suite IDE 3.7.2 (Based on Eclipse Mars.1 (4.5.1)) – Download here
- Spring 4.1.1 – Maven is sufficient, no download is required.
- JDK 1.8 – Download from here
The Spring Tool Suite IDE can be used for developing Spring Boot Applications. Just click on Create new Spring Starter Project to begin with creating your first Spring Boot Application. Instead of downloading a separate IDE for STS, Spring Tools 4 can be installed as a plugin in Eclipse. IDE and Tools; Newcomer Forum; Toggle navigation. Home; Marketplace; Tools (1295) Spring Tools 4 (aka Spring Tool Suite 4) Spring Tools 4 (aka Spring Tool Suite 4).
How to Create Spring MVC Application using Java Configuration
First Create a New Project.
In some of the STS IDE, we can able to select Spring Project directly. If your STS are not having an option then got with this approach. Select Spring Legacy Project from the menu.
Once you select and click on next we will see a window to select Spring MVC Project. At the top we are required to give project name and click next. I have given as STSSpringMVCHelloWorld.
Followed by that we will get a window to give high level package name.
That’s it. We will get a project like this.
In some times we will get a project with errors. To avoid those errors, update the project using maven by following the below image. Right click the project, go to Maven and Update Project.
Spring Tool Suite 4 Download
Once you click Update Project, we will get a window to select the project to Update. Also make sure Force Update of Snapshots/Releases checkbox is unchecked.
This STS bundled with Tomcat 7 and Tomcat 8, so by default we could see Server window in the STS Eclipse (See below Image). So we just have to add the project and start the server. That’s it.
What Is Spring Tool Suite 4
How to add Project to the Server
Follow the below steps and add a Project to the Server which is bundled with STS.
Right click the Server and Click on Add and Remove.
We will see a window like this. Add our project and click on “Finish” and start the server. That’s it.
Open the browser and hit the URL as below.
Spring Tool Suite 4.9.0 Download
I have added my message in HomeController.java and displayed it in home.jsp
We will see in detail about all the files in our next tutorials blogs. This How to Create Spring MVC application using Spring Tool Suite is available in my repository also, to download please click the link below.