springMVC之servlet-config.xml配置
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-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/context
http://www.springframework.org/schema/context/spring-context-4.0.xsd"> <!--使Spring支持自动检测组件,如注解的Controller -->
<context:component-scan base-package="com.parry.test.*" /> <!--*************** 支持aop **************** -->
<aop:aspectj-autoproxy proxy-target-class="true" /> <mvc:resources location="/img/" mapping="/img/**" />
<!-- /js/文件夹下的文件不需要拦截 -->
<mvc:resources location="/js/" mapping="/js/**" />
<!-- /css/文件夹下的文件不需要拦截 -->
<mvc:resources location="/css/" mapping="/css/**" /> <!-- 视图解析器 -->
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/"></property>
<property name="suffix" value=".html"></property>
</bean> <!-- 支持用注解的方式验证参数格式正确性 -->
<mvc:annotation-driven validator="validator" conversion-service="conversion-service" /> <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<!-- <property name="providerClass" value="org.hibernate.validator.HibernateValidator"/> -->
<!--不设置则默认为classpath下的 ValidationMessages.properties
<property name="validationMessageSource" ref="validatemessageSource"/> -->
</bean>
<bean id="conversion-service" class="org.springframework.format.support.FormattingConversionServiceFactoryBean" />
<bean id="validatemessageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:validatemessages"/>
<property name="fileEncodings" value="utf-8"/>
<property name="cacheSeconds" value="120"/>
</bean>
<!-- 拦截器 -->
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/api/*"/>
<bean class="com.parry.test.interceptor.SignatureCheckInterceptor"></bean>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/web/*"/>
<bean class="com.parry.test.interceptor.AccessCheckInterceptor"></bean>
</mvc:interceptor>
</mvc:interceptors>
<mvc:annotation-driven>
</mvc:annotation-driven>
<!-- 文件上传配置 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- 设置上传文件的最大尺寸为1MB -->
<property name="maxUploadSize">
<value>1048576</value>
</property>
<property name="defaultEncoding">
<value>UTF-8</value>
</property>
</bean>
</beans>
springMVC之servlet-config.xml配置的更多相关文章
- SpringMVC快速使用——基于XML配置和Servlet3.0
SpringMVC快速使用--基于XML配置和Servlet3.0 1.官方文档 https://docs.spring.io/spring-framework/docs/5.2.8.RELEASE/ ...
- springMVC WebApplicationInitializer 替代web.xml 配置Servlet 之原理
Servlet 3.0之前 ,xml 配置 在过去搭建spring + springMCV ,首先第一步要做的是什么 ,就是要配置web.xml 文件 ,把springMVC 中的Servlet 加 ...
- Spring+springmvc+Mybatis整合案例 xml配置版(myeclipse)详细版
Spring+springmvc+Mybatis整合案例 Version:xml版(myeclipse) 文档结构图: 从底层开始做起: 01.配置web.xml文件 <?xml version ...
- servlet web.xml配置选项详解
一般的web工程中都会用到web.xml,web.xml主要包括一些配置标签,例如Filter.Listener.Servlet等,可以用来预设容器的配置,可以方便的开发web工程.但是web.xml ...
- springmvc中的web.xml配置(包含中文乱码解决)
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http:// ...
- Mybatis config.xml 配置
<!-- xml标准格式 --><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ...
- servlet的xml配置详解
<?xml version="1.0" encoding="UTF-8"?><web-app xmlns="http://xmlns ...
- cordova 启动界面config.xml配置
<preference name="SplashScreen" value="screen"/> <preference name=" ...
- springmvc框架通过web.xml配置404 500错误导向页
总不能用户输错了url就弹 这玩意吧? <error-page> <error-code>404</error-code> <location>/WEB ...
- springMvc项目的搭建,暂时没有整合持久层框架(java Config配置对比xml配置)
public class WebInit implements WebApplicationInitializer { @Override public void onStartup(ServletC ...
随机推荐
- [转]TextArea设置MaxLength属性最大输入值的js代码
标准的DHTML文档中TEXTAREA的MAXLENGTH属性默认情况下不起作用,只有当事件发生时才起作用 如下:http://spiderscript.net/site/spiderscript/e ...
- jQuery入门第二天&&&正则表达式完结篇——仿smarty引擎的制作
hi 周一完全的不在状态...中午还去观战,没有睡觉的我,晚上的smarty不知道能不能做完,加油吧 1.jQuery ---过滤性选择器(二)--- --[attribute=value]属性选择器 ...
- git 学习使用总结三(远程仓库操作)
这篇文章仅供自己以后翻阅加深记忆,要系统的学习 git 教程(中文版),请移步到 liaoxuefeng.com 学习 git 教程部分. pull, fetch, clone, push, chec ...
- 结对编程项目——四则运算vs版
结对编程项目--四则运算vs版 1)小伙伴信息: 学号:130201238 赵莹 博客地址:点我进入 小伙伴的博客 2)实现的功能: 实现带有用户界面的四则运算:将原只能在 ...
- libsvm Minist Hog 手写体识别(源码文件)
以上是我上一篇文章中的代码实现,里面分别用了opencv中的SVM和LibSVM,opencv的SVM用起来更方便,但貌似内部其实也是基于Libsvm,同样的参数训练出来的结果是一致的,里面有Libs ...
- BestCoder Round #87 1002 Square Distance[DP 打印方案]
Square Distance Accepts: 73 Submissions: 598 Time Limit: 4000/2000 MS (Java/Others) Memory Limit ...
- HOLOLENS的空间管理
http://blog.csdn.net/sun_t89/article/details/52460272
- [No00002A]26个英语字母的原始象形意义、含义、产生及发展历史
我们都知道汉字是象形文字,但如果说英语也是象形文字,你一定会以为纯是无稽之谈.其实,追根溯源,英语的26个字母确实来自于象形文字.这26个字母最初起源于埃及象形文字,后由腓尼基人改进发明了腓尼基字母, ...
- npm换源
作者一介布衣:http://yijiebuyi.com/blog/b12eac891cdc5f0dff127ae18dc386d4.html npm 是node.js 环境下的包管理器,非常强大智能. ...
- Java 集合系列17之 TreeSet详细介绍(源码解析)和使用示例
概要 这一章,我们对TreeSet进行学习.我们先对TreeSet有个整体认识,然后再学习它的源码,最后再通过实例来学会使用TreeSet.内容包括:第1部分 TreeSet介绍第2部分 TreeSe ...