How do you create a Spring MVC project in Eclipse?

后端 未结 5 516
孤城傲影
孤城傲影 2020-12-12 13:33

I am trying to follow the basic tutorial for Spring MVC but got lost at creating a new project in Eclipse.
It seems to me that most tutorials assume you know how to crea

相关标签:
5条回答
  • 2020-12-12 14:18

    Download Spring STS (SpringSource Tool Suite) and choose Spring Template Project from the Dashboard. This is the easiest way to get a preconfigured spring mvc project, ready to go.

    0 讨论(0)
  • 2020-12-12 14:18
    1. step 1: create a new "Dynamic Web Project" in eclipse.
    2. step 2: right click on the created project.
    3. step 3: click on "configure" option.
    4. step 4: click on "convert to maven project".

    here is more detailed information -> [1]: https://crunchify.com/simplest-spring-mvc-hello-world-example-tutorial-spring-model-view-controller-tips/

    0 讨论(0)
  • 2020-12-12 14:23

    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

    0 讨论(0)
  • 2020-12-12 14:27

    This is the easiest way :

    step 1) install Spring Tool Suite (STS) for eclipse (version 3.7.0RELEASE or above) To do this you can go to Help >> eclipse market place , then type Spring Tool suite in search box.

    step 2) now go to file >> new >> spring project as shown in the image below

    step 3)now choose the template as "spring MVC Project" and give a name to your project on the top as shown below ( I named it 'SpringProject')

    step 4)now give a base package name like this

    and that is . The project will be created in a few minutes and Now you can right click on it and run on server.

    0 讨论(0)
  • 2020-12-12 14:29

    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.

    0 讨论(0)
提交回复
热议问题