Spring之web层配置文件

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <beans xmlns="http://www.springframework.org/schema/beans"
 3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
 4     xmlns:mvc="http://www.springframework.org/schema/mvc"
 5     xsi:schemaLocation="http://www.springframework.org/schema/beans
 6         http://www.springframework.org/schema/beans/spring-beans.xsd
 7         http://www.springframework.org/schema/context
 8         http://www.springframework.org/schema/context/spring-context.xsd
 9         http://www.springframework.org/schema/mvc
10         http://www.springframework.org/schema/mvc/spring-mvc.xsd">
11 
12     <!-- 开启mvc注解模式 -->
13     <mvc:annotation-driven />
14 
15     <!-- 配置扫描web包下Controller注解的类 -->
16     <context:component-scan base-package="com.imooc.o2o.web" />
17 
18     <!-- 静态资源默认servlet配置,1、加入对静态资源默认处理包括图片,js,css; -->
19     <mvc:resources location="/resources/" mapping="/resources/**" />
20     <!-- 2、允许 / 整整体映射 -->
21     <mvc:default-servlet-handler />
22 
23     <bean
24         class="org.springframework.web.servlet.view.InternalResourceViewResolver">
25         <property name="prefix" value="/WEB-INF/html" />
26         <property name="suffix" value=".html" />
27     </bean>
28 
29 </beans>

 

转载于:https://www.cnblogs.com/in-the-game-of-thrones/p/11211045.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值