Here is a great starter for this (note : based on crunchify tutorial):
- You first create a dynamic Web project in Eclipse (see here)
- Then you convert the project to Maven project from (right click) Configure/Convert to Maven Project
- Create a Spring configuration file (usually yourproject-servlet.xml). Here you can also use annotation driven view resolving rather than a URL-based. To do that just add " " to your *-servlet.xml file...
- Generate a deployment a descriptor (web.xml) and configure this file. As it is with other servlets this file provides the mapping (among other info) between URLs and servlets. Spring maps the URLs to DispatcherServlet. If you are using Eclipse and started your project as a dynamic Web project, sometimes this file is not generated. But fear not! You can generate a stub file by right clicking your project and choosing Java EE Tools --> Generate Deployment Descriptor Stub ...
- Define your Spring controllers.
- Compiling through Maven : Run as / Maven Build
- Running through Eclipse (make sure you installed Tomcat as a server in Eclipse): Run as / Run on Server.