views:

1418

answers:

3

I am trying to follow basic tutorial for Spring MVC but get lost at creating a new project in Eclipse. It seems that most tutorials assume you know how to create a Spring Project in Eclipse. Any advice on where to get started or tutorials which explain how to set up Eclipse would be appreciated.

+1  A: 

You want to create a "Dynamic Web Project". Follow the steps here: Spring MVC Tutorial with Eclipse and Tomcat.

Also, here is the Eclipse documentation for Dynamic Web Projects: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html

danben
A: 

You can open an example web application that comes with Spring or try the new Spring Roo.

rodrigoap
A: 

You don't necessarily have to create a Spring project. Almost all Java web applications have he same project structure. In almost every project I create, I automatically add these source folder:

  • src/main/java
  • src/main/resources
  • src/test/java
  • src/test/resources
  • src/main/webapp*

src/main/webapp isn't actually a source folder. The web.xml file under src/main/webapp/WEB-INF will allow you to run your java application on any Java enabled web server (Tomcat, Jetty, etc.). I typically add the Jetty Plugin to my POM (assuming you use Maven), and launch the web app in development using mvn clean jetty:run.

Droo