hibernate 在web.xml中配置的作用
1.
<filter>
<filter-name>Spring character encoding filter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>GBK</param-value>
</init-param>
这个是用来处理乱码问题的
2.
<context-param>
<description>spring init </description>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/bean.xml</param-value>
</context-param>
这个配置是用来指定spring配置文件所在的位置的
3.
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
这个是用来对spring容器进行初始化,做为监听器的
4.
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
这是Spring封装hibernate后提供的一个过滤器,这个过滤器的作用是:每一次请求来的时候都打开一个session每次请求结束后关闭session,解析hibernat延迟加载产生的异常。
hibernate 在web.xml中配置的作用的更多相关文章
- web.xml 中配置了error-page但不起作用问题
问题: 在web.xml 中配置了 error-page,但是好像不起作用,就是跳转不到指定的页面. 配置信息如下: <!-- 400错误 --> <error-page> & ...
- web.xml中Listener的作用
Servlet的监听器Listener,它是实现了javax.servlet.ServletContextListener 接口的服务器端程序,它也是随web应用的启动而启动,只初始化一次,随web应 ...
- web.xml中load-on-startup的作用
如下一段配置,熟悉DWR的再熟悉不过了:<servlet> <servlet-name>dwr-invoker</servlet-name> <ser ...
- web.xml中load-on-startup的作用(转)
web.xml中load-on-startup的作用 如下一段配置,熟悉DWR的再熟悉不过了:<servlet> <servlet-name>dwr-invoker< ...
- web.xml中Filter的作用
Servlet中的过滤器Filter是实现了javax.servlet.Filter接口的服务器端程序,主要的用途是过滤字符编码.做一些业务逻辑判断等.其工作原理是,只要你在web.xml文件配置好要 ...
- 在web.xml中配置error-page
在web.xml中配置error-page 在web.xml中有两种配置error-page的方法,一是通过错误码来配置,而是通过异常的类型来配置,分别举例如下: 一. 通过错误码来配置error ...
- web.xml中配置log4j
1.将 commons-logging.jar和 log4j.jar加入你的项目中:2.在src/下创建log4j.properties|log4j.xml文件:3.在web.xml中配置log4j的 ...
- web.xml中配置Spring中applicationContext.xml的方式
2011-11-08 16:29 web.xml中配置Spring中applicationContext.xml的方式 使用web.xml方式加载Spring时,获取Spring applicatio ...
- struts2 在 Action 或 Interceptor 中获取 web.xml 中配置的 <context-param> 参数 (这是我的第一篇博文,哈哈。)
最近为了改一个问题,想加一个控制开关,就在web.xml 中配置了一个 <context-param> 参数,并在 Action 或 Interceptor 中获取参数值. 1.在 web ...
随机推荐
- 五、Springboot 之 自定义配置文件及读取配置文件
说明:建议所有的类应该与spring-boot启动程序同级,不如扫描不到 1.核心配置文件是指在resources根目录下的application.properties或application.yml ...
- Mac系统使用VS Code编译Bootstrap 4
环境: macOS 10.13.6 node.js 8.11.3 sass 1.10.3 bootstrap 4.1.3 vs code 1.25.1 Bootstrap3为我们提供了在线编译工具,可 ...
- OCP试题解析之053-17 CONFIGURE CONTROLFILE AUTOBACKUP ON
17.You configure AUTOBACKUP to ON in an RMAN session. When will RMAN back up the control file? (Choo ...
- linux CMakeLists.txt 语法
CMake入门教程 参考文献:http://www.ibm.com/developerworks/cn/linux/l-cn-cmake/index.html 官方网址:http://www.cmak ...
- 深度增强学习--DDPG
DDPG DDPG介绍2 ddpg输出的不是行为的概率, 而是具体的行为, 用于连续动作 (continuous action) 的预测 公式推导 推导 代码实现的gym的pendulum游戏,这个游 ...
- [Javascript] Automate the process of flattening deeply nested arrays using ES2019's flat method
Among the features introduced to the language of JavaScript in ES2019 is Array.prototype.flat. In th ...
- Android Studio 项目中集成百度地图SDK报Native method not found: com.baidu.platform.comjni.map.commonmemcache.JNICommonMemCache.Create:()I错误
Android Studio 项目中集成百度地图SDK报以下错误: java.lang.UnsatisfiedLinkError: Native method not found: com.baidu ...
- 在xcode5下利用Source Control 做 git 项目管理
xcode5做了很大的更新,其中一点非常实用的功能是集成了Source control项目管理,而且和git做了完美的结合:非常实用: 使用: 在新建项目时,选择 下面的 Create a git r ...
- vue - webpack.dev.conf.js for merge
webpack-merge提供了一个merge连接数组并合并创建新对象的对象的函数.如果遇到函数,它将执行它们,通过算法运行结果,然后再次将返回的值包装在函数中. 这种行为在配置webpack时特别有 ...
- 【MVC+MySQL+EntityFramework】查询性能优化笔记
通过在DbContext中定了表之间的关系,查询后在View中通过item.ProjectOverHour来显示关联表数据. modelBuilder.Entity<ProjectOverHou ...