SpringMVC 基本配置文件
来源:互联网 发布:co网络用语是什么意思 编辑:程序博客网 时间:2024/06/16 21:01
<?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/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"> <!--配置SpringMVC--> <!--1.开启SpringMVC注解模式--> <!--简化配置 1.自动注册DefaultAnnotationHandlerMappper,AnnotationMethodHandlerAdapter 2.提供一系列:数据绑定 数字和日期的format @NumberFormat,@DataTimeFormat, xml/json默认读写支持. --> <mvc:annotation-driven/> <!-- 2.静态资源默认servlet配置 1.对静态资源的处理 2.允许使用/做整体映射 --> <mvc:default-servlet-handler/> <!-- 3.配置jsp显示VideoResolver --> <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean> <!-- 4.扫描web相关的bean --> <context:component-scan base-package="controller,intergrate.controller"/> <!--extention:文件上传--> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="maxUploadSize" value="102400000"/> </bean> <!--extention:json数据--> <mvc:annotation-driven> <mvc:message-converters> <bean class="org.springframework.http.converter.StringHttpMessageConverter"/> <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/> </mvc:message-converters> </mvc:annotation-driven> <!--extention:处理全局异常--> <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"> <property name="exceptionMappings"> <props> <prop key="java.lang.ArithmeticException">error</prop> </props> </property> </bean> <!--extention:自定义拦截器--> <mvc:interceptors> <bean class="interceptor.MyInterceptor"/> </mvc:interceptors> <!--extention:国际化--> <!-- configure the locale resource --> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename" value="locale"/> </bean> <!--可以直接访问WEB-INF下的jsp页面--> <mvc:view-controller path="/locale" view-name="locale"/></beans>
0 0
- SpringMVC 基本配置文件
- Spring+SpringMVC+Mybatis基本配置文件
- springMVC-servlet.xml配置文件的基本配置
- spring+springMVC+mybatis基本配置文件攻略(转)
- SpringMVC配置文件
- SpringMVC配置文件
- springMvc配置文件
- SpringMVC配置文件
- SpringMVC配置文件
- springmvc配置文件
- springMVC配置文件
- SpringMVC 配置文件
- springmvc配置文件
- springMVC配置文件
- SpringMVC配置文件
- SpringMVC 配置文件
- springmvc 配置文件
- SpringMvc 配置文件
- 视频编码会议常用网址
- 关于js中动态生成的点击事件触发两次的讨论
- Base64编码在客户端与服务器传值问题
- 如何让Eclipse的启动速度加快
- bootstrap-file-input使用心得
- SpringMVC 基本配置文件
- Android onMeasure、Measure、measureChild、measureChildren 一些简要说明
- 省赛集训水题 仓库的位置
- DataBinding原理解析
- 关于java开发、网络爬虫、自然语言处理、数据挖掘简介与关系小结
- 玩转物联网之MQTT
- Struts2第三篇【Action开发方式、通配符、Struts常量、跳转全局视图、action节点默认配置】
- [SMOJ1832]交通违法
- postgresql使用RHCS套件搭建HA高可用集群