spring-mvc.xml文件的配置(官方文件)
来源:互联网 发布:数据魔方 免费 编辑:程序博客网 时间:2024/06/05 20:18
<?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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd">
<!-- 开启注解 -->
<context:annotation-config/>
<!-- 开启mvc的注解驱动 -->
<mvc:annotation-driven/>
<!-- 自动扫描controller包下的所有类,使其认为spring mvc的控制器 -->
<context:component-scan base-package="com.yjf.controller"/>
<!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/" p:suffix=".jsp"/>
<!--另一种复杂写法
<property name="prefix" value="/jsp/"></property>
<property name="suffix" value=".jsp"></property>
-->
<!-- 开启注解 -->
<context:annotation-config/>
<!-- 开启mvc的注解驱动 -->
<mvc:annotation-driven/>
<!-- 自动扫描controller包下的所有类,使其认为spring mvc的控制器 -->
<context:component-scan base-package="com.yjf.controller"/>
<!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/" p:suffix=".jsp"/>
<!--另一种复杂写法
<property name="prefix" value="/jsp/"></property>
<property name="suffix" value=".jsp"></property>
-->
<!--由于以上配置已经能够解决问题,所以以下我未使用过-->
<mvc:default-servlet-handler/>
<context:property-placeholder location="classpath:swagger.properties" />
<context:component-scan base-package="com.mangofactory.swagger.springmvc.example" />
<bean id="documentationConfig" class="com.mangofactory.swagger.springmvc.example.config.CustomDocumentationConfig"/>
<bean id="extensibilityModule" class="com.mangofactory.swagger.springmvc.example.config.ExampleExtensibilityModule" />
</beans>
<mvc:default-servlet-handler/>
<context:property-placeholder location="classpath:swagger.properties" />
<context:component-scan base-package="com.mangofactory.swagger.springmvc.example" />
<bean id="documentationConfig" class="com.mangofactory.swagger.springmvc.example.config.CustomDocumentationConfig"/>
<bean id="extensibilityModule" class="com.mangofactory.swagger.springmvc.example.config.ExampleExtensibilityModule" />
</beans>
0 0
- spring-mvc.xml文件的配置(官方文件)
- spring-mvc.xml文件的配置方式
- spring mvc xml文件配置
- Spring MVC的web.xml文件配置详解
- SpringMVC的Java配置替换spring-mvc.xml文件
- 零xml配置Spring MVC文件上传
- spring-mvc.xml文件
- spring MVC 学习笔记与总结1----spring MVC 介绍与基本的.xml文件配置
- spring mvc 配置web.xml servlet.xml文件配置以及出现异常的解决方案
- 配置Spring的XML文件
- 一个spring-mvc.xml文件
- spring mvc 读取xml文件数据库配置参数
- spring mvc配置上传文件的大小
- spring XML文件配置
- spring 配置xml文件
- spring xml文件配置
- spring mvc解决中文乱码问题需在web.xml文件中添加下面的配置
- java spring mvc (一)jar 包以及xml文件配置
- 学习ThinkPHP3.2.2(二):第二个入门例子
- Struts2图片文件上传,判断图片格式和图片大小
- i++和++i区别
- Xcode各个版本下载地址
- git fetch /rebase /merge 使用
- spring-mvc.xml文件的配置(官方文件)
- Android View 事件分发机制 && Android ViewGroup 事件分发机制 源码解析 --总结
- doT.js初窥
- HDU 5194 DZY Loves Balls
- 1013. Battle Over Cities (25) 连通子集 连通分量的数量
- Android 布局优化
- 为什么这段代码输出的是”Hello World”
- ABAP 报表求和统计功能实现方法
- Java多线程文件下载