When checking the operation of dynamic files using eclipse, it only works on that terminal. So, use jetty to check the operation. Also, personally, the maven project in eclipse has a different directory structure, which is annoying.
Add the following plugins.
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
<configuration>
<scanIntervalSecounds>10</scanIntervalSecounds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
Do the following in the command line:
mvn jetty:run
Access http: // localhost: 8080
.
Sometimes jetty didn't work. It took a long time to isolate whether pom.xml is bad, the terminal is bad, or the plugin is bad. As a result, it is better to set up a container for build and check it each time, and I think it is good because there is no dependency problem.
Recommended Posts