Spring MVC Starter

2016-10-29  本文已影响0人  pzzls

Spring MVC Starter

[TOC]

maven

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>4.3.3.RELEASE</version>
</dependency>

<dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.8.4</version>
</dependency>

web.xml

<servlet>    
    <servlet-name>spring</servlet-name>    
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>    
    <load-on-startup>1</load-on-startup>
</servlet>

<servlet-mapping>    
    <servlet-name>spring</servlet-name>    
    <url-pattern>/</url-pattern>
</servlet-mapping>

spring-srtvlet.xml


<context:component-scan base-package="com.spring.starter"/>

<mvc:annotation-driven/>

<mvc:resources mapping="/static/**" location="/static/"/>

上一篇 下一篇

猜你喜欢

热点阅读