- 浏览: 211977 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
springmvc_springjpa:
spring mvc demo教程源代码下载,地址:http: ...
SpringMVC初探_(1) -
LinApex:
测试,如何看性能,如何评比各种服务器,你也写篇日志呗
压力测试 (LoadRunner+Websphere +Tomcat) -
tanying2869:
没找到附件
集成struts2 spring hibernate,使用注解 -
xiaotao.2010:
ranwei09321115 写道晕 不是免费的!...我也发 ...
各种免费的Webservice接口 -
xiaotao.2010:
gaoxingang2008 写道这些方法 都用了 还是不行呀 ...
禁用浏览器后退按钮
将一年前写的SSH基于配置的改成 Hibernate基于注解的配置文件
应用框架:Structs2+Spring2.5+Hibernate3
使用到的包:见附件Project ,ssh Demo
demo 地址:http://url.cn/8kuh1Z
直接上代码
applicationContext.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: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-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> <!-- 读取properties文件 --> <bean id="common.propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreResourceNotFound" value="true" /> <property name="ignoreUnresolvablePlaceholders" value="true" /> <property name="fileEncoding" value="UTF-8" /> <property name="locations"> <list> <value>classpath*:conf/*.properties</value> <value>classpath*:*.properties</value> </list> </property> </bean> <!-- 数据源 --> <bean id="myDataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${hibernate.jdbc.driverClassName}" /> <property name="url" value="${hibernate.jdbc.url}" /> <property name="username" value="${hibernate.jdbc.username}" /> <property name="password" value="${hibernate.jdbc.password}" /> </bean> <!-- SessionFactory 使用配置文件 --> <!-- <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="myDataSource" /> <property name="mappingResources"> <list> <value>com/ibm/ssh/bean/Student.hbm.xml</value> <value>com/ibm/ssh/bean/Navigation.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <value> hibernate.dialect=${hibernate.dialect} hibernate.show_sql=${hibernate.show_sql} hibernate.format_sql=${hibernate.format_sql} hibernate.hbm2ddl.auto=${hibernate.hbm2ddl.auto} </value> </property> </bean> --> <!-- SessionFactory 使用注解 --> <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="myDataSource" /> <property name="annotatedClasses"> <list> <value>com.ibm.ssh.bean.Teacher</value> </list> </property> <property name="hibernateProperties"> <value> hibernate.dialect=${hibernate.dialect} hibernate.show_sql=${hibernate.show_sql} hibernate.format_sql=${hibernate.format_sql} hibernate.hbm2ddl.auto=${hibernate.hbm2ddl.auto} </value> </property> </bean> <!-- Dao 配置文件 --> <bean id="studnetDao" class="com.ibm.ssh.daoImpl.StudentDaoImpl"> <property name="sessionFactory" ref="mySessionFactory"></property> </bean> <bean id="navigationDao" class="com.ibm.ssh.daoImpl.NavigationDaoImpl"> <property name="sessionFactory" ref="mySessionFactory"></property> </bean> <!-- Action 配置 --> <bean id="userShowAction" class="com.ibm.ssh.action.UserShowAction"> <property name="studentDao" ref="studnetDao"></property> </bean> <bean id="navigationAction" class="com.ibm.ssh.action.NavigationAction"> <property name="navigationDao" ref="navigationDao"></property> </bean> </beans>
发表评论
-
键码(KeyCode)
2013-02-28 16:32 18840字母和数字键的键码值(keyCode) 按键 键 ... -
Hibernate基于注解_Oracle
2012-10-10 23:30 1093不细说了直接上代码 代码中的注释可以参考Hiberna ... -
1111111
2012-08-24 14:35 0{id=news_ln_statistics, categor ... -
my aa
2012-07-18 17:15 19女士们,先生们,早上好!很荣幸有机会参加此次面试。我希望今天 ... -
备份配置 - spring
2011-04-16 20:43 609<?xml version="1.0" ... -
Hibernate-学习笔记06-Relationship-One2One
2011-04-14 20:57 1055Hibernate真的很强大,尤其是在关系这方便,方便到只要你 ... -
Spring-学习笔记01-CrossCuttingConcern
2011-04-14 19:30 882近做Spring试验发现了个问题: 1、advice不能监控 ... -
Hibernate-学习笔记05-数据持久化的三种状态
2011-04-13 20:26 1432Hibernate 数据持久化 ... -
Hibernate-学习笔记04-数据更新方法
2011-04-13 20:02 4197试验目的: 更新数 ... -
Hibernate-学习笔记03-getCurrentSession和openSession区别
2011-04-12 19:52 1502SessionFactory得到Session的方法有两种ge ... -
Hibernate-学习笔记01
2011-04-11 15:53 1056第一个Hibernate小程序 Hiberna ... -
Interceptor的初步认识
2011-03-31 18:15 1074一个名称 : AOP(Aspect ... -
Struts2 Action中的数据填充
2011-03-31 13:53 1870开门见山 直接上代码 ... -
struts-笔记-7
2011-03-18 16:02 8668 Dynamic ActionForm ... -
struts-笔记-6
2011-03-18 16:01 9887 标签 Struts ... -
Struts-笔记-5
2011-03-18 15:57 10166.Struts 的 MVC 组件 ... -
Struts-笔记-4
2011-03-18 15:55 7714.Struts 工作原理和开发流程 4 ... -
Struts-笔记-3
2011-03-18 15:54 10763. 用 struts 开发简单的登录示例程 ... -
Struts-笔记-2
2011-03-18 15:53 8322 . 搭建 Struts 开发环境 ... -
Struts-笔记-1
2011-03-18 15:50 833******************************* ...
相关推荐
ssh配置文件ssh配置文件ssh配置文件ssh配置文件
JavaEE SSH 配置文件集合 本人仔细整理收集的 三大框架配置文件详解
strust2 spring hibernate三个框架的三个配置文件例子
SSH配置文件:struts.xml,根据https://www.cnblogs.com/gt18552/p/5842745.html做下来的,有时间写一下遇到的问题和解决方案
SSH配置文件,适合新手使用
这是我做的SSH配置文件的提示的插件,是Eclipse版本的。
ssh框架整合maven+ssh配置文件,包括hibernate详细配置,struts2的详细配置,spring的整合配置
这是我做的MyEclipse版本的SSH配置文件提示的插件,如果有问题参照我的博客:http://blog.csdn.net/long2010yu2010
ssh配置文件[总结].pdf
ssh配置文件[参照].pdf
aws-ssh-config, 从 AWS EC2清单生成SSH配置文件 aws-ssh-config描述使用boto查询 AWS API并生成一个准备使用的SSH配置文件的非常简单的脚本。 有几个类似的脚本,但我找不到一个能够满足我所有的愿望列表:立即连接...
SSH三大框架集成或单独配置相关配置文件详解,超全!
可以看到配置文件的步骤: 1、 配置数据源 2、 配置会话工厂(依赖注入上面的数据源,还要注入hbm映射文件[注意正确的位置]、hibernate属性文件) 3、 配置事务管理器(依赖注入上面的会话工厂) 4、 Spring中声明...
关于在ssh项目开发中 ,applicationcontext.xml 的配置
ssh 配置文件完整视频实例 ssh 配置文件完整视频实例ssh 配置文件完整视频实例ssh 配置文件完整视频实例
SSH配置详解SSH配置详解SSH配置详解SSH配置详解
ssh框架整合配置文件 ssh框架整合配置文件 ssh框架整合配置文件 ssh框架整合配置文件 ssh框架整合配置文件 ssh框架整合配置文件 ssh框架整合配置文件 ssh框架整合配置文件 ssh框架整合配置文件 ssh框架整合配置文件 ...