1

I just began learning Spring MVC, using this tutorial.

Entire write and build (under Eclipse) went successfully and a target .war file is generated.

However, I need to test-run it and I do not wish to download and install Tomcat at the moment.

I have heard there is a way to run it from within Eclipse without requiring a full-fledged Tomcat installation. How do I do that?

WebViewer
  • 761
  • 7
  • 21
  • This might help you: https://stackoverflow.com/questions/26105061/spring-boot-without-the-web-server – x86-64 Aug 08 '18 at 13:25

1 Answers1

1
  1. Add to your pom.xml the tomcat-plugin:

`

  <plugin>
    <groupId>org.apache.tomcat.maven</groupId>
    <artifactId>tomcat7-maven-plugin</artifactId>
    <version>2.2</version>
    <configuration>
        <path>/</path>
    </configuration>
  </plugin>

`

  1. In Eclipse, add a debug/run configuration for Maven Build: Right-click New, and in that new configuration's Goals enter: clean install tomcat7:run

  2. Now run that configuration (right-click pom.xml > Run as > Run configuration)

Very Objective
  • 601
  • 7
  • 16
  • Indeed, Maven magically downloaded all sorts files and started Tomcat on `http://localhost:8080` but for some reason it keeps giving 404 error similar to the problem described here: https://stackoverflow.com/q/34968472 What am I missing in configuring it properly so that all `.jsp` pages are viewable? – WebViewer Aug 08 '18 at 17:36