[springMvc]常见配置
2024-09-01 22:33:47
[springMvc]常见配置
<?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"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="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/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
<!-- 配置自动扫描的包 -->
<context:component-scan base-package="com.booway.mhsy.*"></context:component-scan>
<!-- 配置注解驱动 -->
<mvc:annotation-driven>
<!-- 配置json,支持json解析 -->
<mvc:message-converters register-defaults="true">
<bean id="fastJacksonMessageConverter" class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>application/json;charset=UTF-8</value>
</list>
</property>
<property name="dateFormat" value="yyyy-MM-dd HH:mm:ss"></property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<!-- 配置视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name = "prefix" value="/WEB-INF/"></property>
<property name = "suffix" value = ".jsp"></property>
</bean>
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<property name="order" value="1" /> <property name="defaultViews">
<list>
<!-- JSON View -->
<bean
class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">
</bean>
</list>
</property>
</bean>
</beans>
[springMvc]常见配置
最新文章
- UIAlertController警告视图和操作表单
- 自定义控件EditText
- Pig Latin
- 微软BI 之SSIS 系列 - 在 SQL 和 SSIS 中实现行转列的 PIVOT 透视操作
- canvas的代码封装
- JAVA_build_ant_mapper
- windows下搭建及配置mantis缺陷管理工具
- django之CSRF
- HTTP/2协议–特性扫盲篇
- [Angular] &#39;providedIn&#39; for service
- MySQL面试题和答案
- [UE4]制作视野图标
- 【转】CentOS 5 上安装git
- Cookie的Domain属性
- cxf soap rest webservice spring
- composer install 失败,无法用 unzip 解压归档、proc_open() 函数未支持
- 用PHP去实现数据库查询结果缓存
- BZOJ 2243 染色 (线段树+树链剖分)
- kalilinux基础
- Found 1 slaves: Use of uninitialized value in printf at /usr/local/percona-toolkit/bin/pt-online-schema-change line 8489
热门文章
- Flask使用bootstrap为HttpServer添加上传文件功能
- 关于非阻塞I/O、多路复用、epoll的杂谈
- JGit----将 Git 嵌入你的应用
- [leetcode] H-Index (Hash Table)
- shell 文本单词计数
- 阿里巴巴的 Kubernetes 应用管理实践经验与教训
- HDU1944 S-NIM(多个NIM博弈)
- 【CuteJavaScript】Angular6入门项目(4.改造组件和添加HTTP服务)
- kubernetes-单机实验(入门)
- LNMP-Nginx配置不记录静态文件、过期时间