The easiest way to get up and running with a Spring MVC project is to use SpringSource Tool Suite, which is another free IDE based on Eclipse.
The integration between the IDE and Spring/Maven is tight, and it comes with an application server already setup for you to deploy your web app.
Follow these steps to get a working Spring MVC web app.
- To setup a new project in STS: Click File -> New -> Spring Template Project -> Spring MVC Project
- To pull in dependencies and compile your project: Right click your new project -> Run As -> Maven install
- To run your project inside an application server: Right click your new project -> Run As -> Run on Server -> SpringSource tc Server
If it works, you'll see a web page saying "Congratulations! You're running Spring!"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…