用maven创建Spring4MVC helloworld

maven jetty:run
在pom.xml里面加入

  <plugins>
   <!-- 配置加入jetty服务器,开发时我们一般使用jetty服务器 -->
   <plugin>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jetty-maven-plugin</artifactId>
    <configuration>
     <!-- 设置扫描target/classes内部文件变化时间间隔 -->
     <!--<scanIntervalSeconds>10</scanIntervalSeconds> -->
     <webApp>
      <contextPath>/</contextPath>
     </webApp>
    </configuration>
   </plugin>
  </plugins>

另外,在pom.xml文件里面不要加入jsp-api.jar和servlet-api.jar。

springmvc只需要加入如下jar包
jstl
standard
spring-context
spring-webmvc
aspectjtools

参考文档:
http://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html#jetty-run-goal
Spring MVC 4 - Hello World Tutorial http://www.tuicool.com/articles/uUBNni
http://www.beingjavaguys.com/2013/06/spring-4-whats-new-simple-hello-world.html
http://crunchify.com/hello-world-example-spring-mvc-3-2-1/
Spring 3 MVC Hello World Example http://www.mkyong.com/spring3/spring-3-mvc-hello-world-example/  

ps:D:\wsSpirngMVCMaven\springmvcMaven

猜你喜欢

转载自dy-f.iteye.com/blog/2015163
今日推荐