关于springmvc的配置文件
开发常用的springmvc.xml配置文件,spring 3.0 spring-servlet.xml配置。
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Bean头部 -->
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
- <!-- 加载权限设置 -->
- <bean id="security" class="com.boaotech.util.Security"
- p:contextConfigLocation="WEB-INF/security.xml" />
- <!-- 加载菜单项 -->
- <bean id="menus" class="com.boaotech.util.Menus"
- p:contextConfigLocation="WEB-INF/menus.xml" p:security-ref="security" />
- <!-- Json返回格式化转换 -->
- <bean id="mappingJacksonHttpMessageConverter"
- class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />
- <!-- 设置全局日期参数的字符串表示格式 -->
- <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
- <property name="webBindingInitializer">
- <bean class="com.boaotech.util.CommonBindingInitializer"/>
- </property>
- <property name="messageConverters">
- <list>
- <ref bean="mappingJacksonHttpMessageConverter"/>
- </list>
- </property>
- </bean>
- <!-- 激活@Controller模式 -->
- <mvc:annotation-driven />
- <!-- 对包中的所有类进行扫描,以完成Bean创建和自动依赖注入的功能 需要更改-->
- <context:component-scan base-package="com.boaotech.zhaotaoerp" />
- <context:annotation-config/>
- <!-- 激活计划任务注解 -->
- <task:annotation-driven executor="myExecutor" scheduler="myScheduler"/>
- <task:scheduler id="myScheduler" pool-size="1"/>
- <task:executor id="myExecutor" pool-size="1"/>
- <!-- 配置拦截器 -->
- <mvc:interceptors>
- <bean id="authorizeInterceptor" class="com.boaotech.util.AuthorizeInterceptor" />
- </mvc:interceptors>
- <!-- 类名到视图名的自动映射 -->
- <!-- bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/ -->
- <!-- FreeMarker配置文件 -->
- <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
- <property name="templateLoaderPath" value="/WEB-INF/ftl/"/>
- <property name="freemarkerSettings">
- <props>
- <prop key="template_update_delay">5</prop>
- <prop key="default_encoding">UTF-8</prop>
- <prop key="locale">zh_CN</prop>
- </props>
- </property>
- </bean>
- <!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 -->
- <bean id="viewResolver"
- class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"
- p:cache="true" p:prefix="" p:suffix=".ftl"
- p:contentType="text/html;charset=UTF-8"
- p:exposeRequestAttributes="true" p:exposeSessionAttributes="true"
- />
- <!-- bean id="viewResolver"
- class="org.springframework.web.servlet.view.InternalResourceViewResolver"
- p:viewClass="org.springframework.web.servlet.view.JstlView" p:prefix="/WEB-INF/jsp/"
- p:suffix=".jsp" / -->
- </beans>
- <?xml version="1.0" encoding="UTF-8"?>
- <!-- Bean头部 -->
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
- http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd">
- <!-- 加载权限设置 -->
- <bean id="security" class="com.boaotech.util.Security"
- p:contextConfigLocation="WEB-INF/security.xml" />
- <!-- 加载菜单项 -->
- <bean id="menus" class="com.boaotech.util.Menus"
- p:contextConfigLocation="WEB-INF/menus.xml" p:security-ref="security" />
- <!-- Json返回格式化转换 -->
- <bean id="mappingJacksonHttpMessageConverter"
- class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter" />
- <!-- 设置全局日期参数的字符串表示格式 -->
- <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
- <property name="webBindingInitializer">
- <bean class="com.boaotech.util.CommonBindingInitializer"/>
- </property>
- <property name="messageConverters">
- <list>
- <ref bean="mappingJacksonHttpMessageConverter"/>
- </list>
- </property>
- </bean>
- <!-- 激活@Controller模式 -->
- <mvc:annotation-driven />
- <!-- 对包中的所有类进行扫描,以完成Bean创建和自动依赖注入的功能 需要更改-->
- <context:component-scan base-package="com.boaotech.zhaotaoerp" />
- <context:annotation-config/>
- <!-- 激活计划任务注解 -->
- <task:annotation-driven executor="myExecutor" scheduler="myScheduler"/>
- <task:scheduler id="myScheduler" pool-size="1"/>
- <task:executor id="myExecutor" pool-size="1"/>
- <!-- 配置拦截器 -->
- <mvc:interceptors>
- <bean id="authorizeInterceptor" class="com.boaotech.util.AuthorizeInterceptor" />
- </mvc:interceptors>
- <!-- 类名到视图名的自动映射 -->
- <!-- bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/ -->
- <!-- FreeMarker配置文件 -->
- <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
- <property name="templateLoaderPath" value="/WEB-INF/ftl/"/>
- <property name="freemarkerSettings">
- <props>
- <prop key="template_update_delay">5</prop>
- <prop key="default_encoding">UTF-8</prop>
- <prop key="locale">zh_CN</prop>
- </props>
- </property>
- </bean>
- <!-- 对模型视图名称的解析,即在模型视图名称添加前后缀 -->
- <bean id="viewResolver"
- class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver"
- p:cache="true" p:prefix="" p:suffix=".ftl"
- p:contentType="text/html;charset=UTF-8"
- p:exposeRequestAttributes="true" p:exposeSessionAttributes="true"
- />
- <!-- bean id="viewResolver"
- class="org.springframework.web.servlet.view.InternalResourceViewResolver"
- p:viewClass="org.springframework.web.servlet.view.JstlView" p:prefix="/WEB-INF/jsp/"
- p:suffix=".jsp" / -->
- </beans>
关于springmvc的配置文件的更多相关文章
- 3.SpringMVC修改配置文件路径和给界面传递数据
1.修改配置文件路径 达到 配置多文件的目的 web.xml文件中基础配置有springMVC配置的servlet路径 <servlet-name>SpringMVC</serv ...
- SpringMVC深度探险(四) —— SpringMVC核心配置文件详解
在上一篇文章中,我们从DispatcherServlet谈起,最终为读者详细分析了SpringMVC的初始化主线的全部过程.整个初始化主线的研究,其实始终围绕着DispatcherServlet.We ...
- ssm框架 spring的主配置文件 spring-mvc主配置文件 web.xml配置文件(基础的配置文件)
1.spring主配置文件 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns=" ...
- (转)SpringMVC学习(三)——SpringMVC的配置文件
http://blog.csdn.net/yerenyuan_pku/article/details/72231527 读者阅读过SpringMVC学习(一)——SpringMVC介绍与入门这篇文章后 ...
- Spring+SpringMVC整合----配置文件
1.在 web.xml 中加载 spring 的配置文件 bean.xml 底层是 Listener <!-- Spring --> <context-param> &l ...
- 加载自定义目录下的springmvc.xml配置文件
在默认情况下:springmvc框架的配置文件必须叫<servlet-name>-servlet.xml 且必须放在/WEB-INF/目录下,我们可以在web.xml文件中,为Dispat ...
- springMVC项目配置文件
一.springMVC项目配置文件 1.web.xml文件全局配置 <servlet> <servlet-name> dispatcher </servlet-name& ...
- spring-mvc.xml配置文件出错
在整合ssm三大框架的时候,配置spring-mvc.xml的文件的 <mvc:default-servlet-handler/> <mvc:annotation-driven /& ...
- Spring+SpringMVC重复加载配置文件问题
sping+springmvc的框架中,IOC容器的加载过程 http://my.oschina.net/xianggao/blog/596476 基本上是先加载ContextLoaderListen ...
随机推荐
- python 面向对象和类成员和异常处理
python 面向对象 你把自己想象成一个上帝,你要创造一个星球,首先你要把它揉成一个个球,两个直径就能创造一个球 class star: '''名字(name),赤道直径(equatorial di ...
- ATL开发 ActiveX控件的 inf文件模板
ATL开发 ActiveX控件的 inf文件模板
- Android之TextView灵活使用(转载)
在项目中有无遇到过这样一种程况,例如文字"王明今年10岁了", 但是数字10是从网络返回的数据, 而你又想把这个文字写在xml中, 过往我的做法是分成3个TextView, 实现愚 ...
- Lambda GroupBy Sum
DataTable dt = new DataTable(); dt.AsEnumerable().GroupBy(r => r["ShopName"]) .Select(g ...
- Linux C 开发环境配置
换了新电脑,重装了Fedora10,所有开发环境都要重新配置啦,开个随笔记录下过程,说不定以后还要用~ 首先Fedora10装好之后是不带 VIM 的,果断安装之: 打开终端,首先 su 命令切换到r ...
- VS使用过程中,编写JS没有智能提示解决方法
问题:编写基本Script代码没有问题,但是在编写DOM代码时候没有智能提示.也就是在编写一般javascript代码时候没有问题,但是要写DOM代码的时候发现没有智能提示,如document等都需要 ...
- JCCLIENT IP GET UDP
##通道##110.52.233.5:18427## ##通道##112.95.251.214:18427## ##通道##119.29.192.206:18427## ##通道##123.207.1 ...
- REST 风格的api
REST即表述性状态传递,是设计风格不是标准.REST架构风格有以下6个约束: 1. 客户-服务器(Client-Server):通信只能由客户端单方面发起,表现为请求-响应形式. 2.无状态:通信的 ...
- JS中this的指向问题
JS中this的定义:this对象是在运行时基于函数的执行环境绑定的(通俗点来说就是:this代表当前函数属于哪个对象). this一般情况下都代表的是global对象,在浏览器中就是window对象 ...
- oracle 的 nubmer 类型与 C# 的 float double decimal 对应关系
如果先有oracle 数据的情况下,怎么对应到C#中的类型. 在oralce 中 在dba_tab_columns表中, Data_type表示字段类型:Data_length表示字段类型的长度:Da ...