首页 / XML / spring-mvc.xml中的配置
spring-mvc.xml中的配置
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了spring-mvc.xml中的配置,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2512字,纯文字阅读大概需要4分钟。
内容图文
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:mvc ="http://www.springframework.org/schema/mvc" 4 xmlns:p ="http://www.springframework.org/schema/p" xmlns:context ="http://www.springframework.org/schema/context" 5 xmlns:aop ="http://www.springframework.org/schema/aop" xmlns:tx ="http://www.springframework.org/schema/tx" 6 xsi:schemaLocation ="http://www.springframework.org/schema/beans 7 http://www.springframework.org/schema/beans/spring-beans-3.2.xsd 8 http://www.springframework.org/schema/context 9 http://www.springframework.org/schema/context/spring-context-3.2.xsd 10 http://www.springframework.org/schema/aop 11 http://www.springframework.org/schema/aop/spring-aop-3.2.xsd 12 http://www.springframework.org/schema/tx 13 http://www.springframework.org/schema/tx/spring-tx-3.2.xsd 14 http://www.springframework.org/schema/mvc 15 http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd 16 http://www.springframework.org/schema/context 17 http://www.springframework.org/schema/context/spring-context-3.2.xsd" > 18 19 <!-- 使Spring支持自动检测组件,如注解的Controller --> 20 < context:component-scan base-package ="cn.smart.webapp.controller" /> 21 < context:annotation-config /> 22 23 24 <!-- 避免IE执行AJAX时,返回JSON出现下载文件 --> 25 < bean id ="mappingJacksonHttpMessageConverter" 26 class ="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" > 27 < property name ="supportedMediaTypes" > 28 < list > 29 < value >text/html;charset=UTF-8</value>30</list>31</property>32</bean>333435<!-- 启动SpringMVC的注解功能,完成请求和注解POJO的映射 -->36<bean 37class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">38<property name="messageConverters">39<list>40<ref bean="mappingJacksonHttpMessageConverter"/><!-- JSON转换器 -->41</list>42</property>43</bean>444546<!-- jsp视图解析器 -->47<bean id="jspViewResolver"48 class="org.springframework.web.servlet.view.InternalResourceViewResolver">49<property name="viewClass"50 value="org.springframework.web.servlet.view.JstlView"/>
//下面value中的是jsp所在的路径 51 < property name ="prefix" value ="WEB-INF/view/" /> 52 < property name ="suffix" value =".jsp" /> 53 54 </ bean > 55 </ beans >
原文:http://www.cnblogs.com/MrzhangKk/p/5274892.html
内容总结
以上是互联网集市为您收集整理的spring-mvc.xml中的配置全部内容,希望文章能够帮你解决spring-mvc.xml中的配置所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。