Skip to main content

Create a Spring MVC Project In a Simple Way Using STS

Introduction

Hi everyone, long time no see.  Today I will show you how to create a spring mvc project in STS, it is very simple!

Process

Open your STS, if you haven’t got it, please visit:http://www.springsource.org/sts to download. Now you got such as follows:

STS

It’s a nice and clean work space, and starts quickly. Let’s see how to create a spring mvc project. Right click the white space in the package explorer. Select New then Other…, in the popup menu.

2013-6-5 21-49-46

 

In the New dialog, open Spring folder and select Spring template project. Click next.

2013-6-5 21-50-12

 

In this process, select Spring MVC Project. Click Next.

2013-6-5 21-50-35

 

It will promote spring mvc project requires download some stuff, click Yes, then click Next.

2013-6-5 21-50-48

 

Type your project name and the top level package name, click Finish.

2013-6-5 21-51-05

 

Now you will have the following file structure. A HomeController, home.jsp file, and two spring configuration files, root-context.xml and servlet-context.xml. You can check the source code, they are very basic. Now you could develop your spring mvc project out of box.

2013-6-5 21-58-01

Conclusion

Is it very simple? Yes, it saves us plenty of time to write configuration files, and maintain dependencies. You should notice that this wizard will finally create a maven project, so if you are unfamiliar with maven, please visit http://maven.apache.org/ for details. Thank you very much!