- 浏览: 206570 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
hui963966800:
如何在上传完图片生成的<img>标签中把项目的域名 ...
CKEditor文件上传-多种方式-与ckfinder结合上传 -
zqb666kkk:
ajaxForm是 第三方插件的方法?
artDialog弹出新页面,保存后关闭弹出框并刷新父页面 -
wang_wenjing:
可以生效,多谢
js按比例缩放图片且垂直居中显示图片
配置方法1:
***********************************web.xml*****************************************
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:applicationContext-*.xml,/WEB-INF/applicationContext*.xml </param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <filter> <filter-name>lazyLoadingFilter</filter-name> <filter-class> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter </filter-class> </filter> <filter> <filter-name>s2</filter-name> <filter-class> org.apache.struts2.dispatcher.FilterDispatcher </filter-class> </filter> <filter-mapping> <filter-name>lazyLoadingFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> <filter-mapping> <filter-name>s2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- <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> </filter> <filter-mapping> <filter-name>Spring character encoding filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> --> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
**************************aplicationContext-common.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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"> </property> <property name="url" value="jdbc:mysql://localhost:3306/spring_hibernate_1?characterEncoding=utf-8"> </property> <property name="username" value="root"></property> <property name="password" value="root"></property> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource"> <ref bean="dataSource" /> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect"> org.hibernate.dialect.MySQLDialect </prop> <prop key="hibernate.show_sql">true</prop><!--显示SQL语句--> <prop key="hibernate.format_sql">true</prop> </props> </property> <property name="mappingResources"> <list> <value>com/bcm/model/Author.hbm.xml</value> </list> </property> </bean> <!-- 配置事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"> <ref bean="sessionFactory" /> </property> </bean> <!-- 配置事务的传播特性 --> <tx:advice id="txAdvice" transaction-manager="transactionManager"> <tx:attributes> <tx:method name="add*" propagation="REQUIRED" /> <tx:method name="del*" propagation="REQUIRED" /> <tx:method name="modify*" propagation="REQUIRED" /> <tx:method name="*" read-only="true" /> </tx:attributes> </tx:advice> <!-- 那些类的哪些方法参与事务 --> <aop:config> <aop:pointcut id="allManagerMethod" expression="execution(* com.bcm.service.impl.*.*(..))" /> <aop:advisor pointcut-ref="allManagerMethod" advice-ref="txAdvice" /> </aop:config> </beans>
**************************aplicationContext-bean.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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <bean id="AuthorDaoImpl" class="com.bcm.dao.impl.AuthorDaoImpl"> <property name="sessionFactory" ref="sessionFactory"></property> </bean> <!--Dao层的实现类,因为继承HibernateDaoSupport 所以是需要注入sessionFactory的 --> <bean id="AuthorServiceImpl" class="com.bcm.service.impl.AuthorServiceImpl"> <property name="authordao" ref="AuthorDaoImpl"></property> </bean> </beans>
**************************aplicationContext-action.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.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <!-- 此处的id="addAction" 必须与struts.xml中class="addAction"相一致--> <bean id="addAction" class="com.bcm.action.AuthorAction" scope="prototype"> <property name="authorservice" ref="AuthorServiceImpl"></property> </bean> </beans>
*************************struts.xml********************************************
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.objectFactory" value="spring"></constant> <constant name="struts.i18n.encoding" value="gbk"></constant> <package name="struts2" extends="struts-default"> <action name="add" class="addAction" method="add"> <result>index.jsp</result> </action> <action name="log" class="logAction" method="add"> <result type="redirect-action">list.action</result> </action> <action name="list" class="listAction" method="list"> <result>list.jsp</result> </action> </package> </struts>
备注:aplicationContext.xml文件 最好分为几个 如:
* aplicationContext-common.xml (用于配置事务,数据源...)
* aplicationContext-bean.xml(用于配置普通的类)
* aplicationContext-action.xml(用于配置action)
发表评论
-
spring连接池配置详解
2013-09-06 15:20 0首次遇到一次插人2W多条数据的问题,而且每条数据查询是否存在 ... -
Spring JPA 批注参考(查询备用)
2013-08-29 15:45 1630JPA 批注参考 版本: ... -
Spring JPA 查询的几种方式并处理分页
2013-08-29 15:36 8802第一种 NamedQuery(返回方式为列模式[原生态sq ... -
Spring JPA annotation关于一对多,多对一的那些纠结
2013-07-02 11:50 1500近日用到了Hibernate JPA 一对多,多对一的功能 ... -
实现基于Spring框架应用的权限控制系统security
2013-06-20 18:22 1069引言 近年来,随 ... -
Spring JPA 分页结合WEB框架DWZ显示 2种方法
2013-06-05 12:16 2845本文章结合Spring JPA 与 DWZ框架,描述分页。 ... -
Spring JPA JPQL的介绍
2013-05-31 18:00 1685JPQL就是一种查询语言 ... -
Spring Data JPA 开发过程中遇到的问题
2013-05-24 12:36 1377注意事项: 1)执行修改操作时 1.如果数据库设置了某 ... -
Hibernate注解-很全的
2013-05-24 11:55 1173Hibernate注解感觉比配xml的方便多了,下面一些记录 ... -
Spring实现自动任务调度【转】
2012-08-24 18:54 563Spring内部有一个task是Spr ... -
hibernate 锁
2012-06-11 23:01 619hibernate锁机制包括悲观锁和乐观锁 1.悲观锁: ... -
Hibernate映射类型对照表
2012-04-10 22:42 1241Hibernate映射类型对照表 java类型 H ... -
Hibernate HQL检索方式
2012-04-08 00:31 968Hibernate提供了以下几种检索对象的方式. 1) ... -
Struts2 Filter的功能
2012-04-08 00:31 39711.org.apache.struts2.dispatcher ... -
hibernate中lazy的使用
2012-04-07 20:43 563lazy,延迟加载 Lazy的 ...
相关推荐
基于Annotation的s2sh整合配置实现分页功能基于Annotation的s2sh整合配置实现分页功能基于Annotation的s2sh整合配置实现分页功能基于Annotation的s2sh整合配置实现分页功能基于Annotation的s2sh整合配置实现分页功能
s2sh整合步骤及配置文件配置s2sh整合步骤及配置文件配置s2sh整合步骤及配置文件配置s2sh整合步骤及配置文件配置
s2sh整合配置文档基于jpa
s2sh框架整合完整demo,可直接运行,含数据库建表sql 所采用的框架版本为:Struts 2.1.8, Sping2.5.5, Hibernate 3.5.6
很详细的S2SH配置,struts2 2.1.8 hibernate3.0 spring2.5 整合配置 详细代码 学习啦
Struts2.0.14+Spring2.5+Hibernate3.2+Oracle10g+Tomcat6.0开发环境配置,有步骤图示 +web.xml+applicationContext.xml文件配置 还算齐全。。。
非常适合初学者掌握ssh2整合的例子,献给初学者
S2SH整合后的相关完整配置文件,beans.xml,struts.xml,log4j.properties以及web.xml
s2sh框架整合jar及配置方法,jar可以直接考到lib下,按照txt配置即可
S2SH整合例子 注解配置 JSON 泛型Dao
s2sh整合,s2sh,langsin,浪曦oa工作流源码。上传有限。里面没带jar文件 配置完整.
s2sh开发环境配置文档,关于S2SH存在struts2,spring2.5,hibernate3.2之间的整合。
Struts2.3+hibernate4.3+spring3大框架的整合,里面整合了相关的工具类,很方便使用,尤其适合初学者拿来研究,配置什么的比较齐全,改改数据库可以直接运行,包含注册,登录,等功能,增删改查都有,还有一个30选7...
S2SH整合(jar包和配置干净齐全) 适合项目刚开始搭建S2SH环境!
struts2 spring hibernate的完整整合,包括的 配置文件和注解的不同方式
为刚入门的学习人员提供些整合的思路
struts,hibernate,spring框架包整合与相关配置文件的配置
绝对超值 解压导入项目到IDE 即可运行 当然数据库需要自己建个表 很简单 完成了 对数据的增 删 改 查 新手速度下
最新SSH整合实例 使用目前最新版本的S2SH框架 struts2 3 16 3+spring4 0 4+hibernate4 3 5 的搭建DEMO 里面的配置齐全 xml都有配置demo lib包下为整合的最小jar包 需要其他功能的自行添加 myeclipse项目。
此框架为struts2+spring3.0+hibernate的整合以及配置,加载项目即可使用,其中含有mysql以及Oracle的配置。为了方便学习者使用,再次我写入了增删改查,还有所需的s2sh整合的jar包