码迷,mamicode.com
首页 > 编程语言 > 详细

spring mvc 配置对静态资源的访问

时间:2015-01-22 15:02:48      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:

在spring mvc的配置文件中做如下配置:

1、

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
    <context:component-scan base-package="com.vrvwh.wh01.controller">
    </context:component-scan>
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value=""></property>
        <property name="suffix" value=".jsp"></property>
    </bean>
<!-- 默认的注解映射的支持 -->
<mvc:annotation-driven />
  <!--对静态资源文件的访问 -->
<mvc:default-servlet-handler />
</beans>

 

1、

<mvc:default-servlet-handler />

 

spring mvc 配置对静态资源的访问

标签:

原文地址:http://www.cnblogs.com/tyb1222/p/4241324.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!