<!---->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<import resource="cacheContext.xml"/>
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" >
<property name="locations">
<list>
<value>/jdbc.properties</value>
</list>
</property>
</bean>
<bean id="mydataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>${jdbc.driver}</value>
</property>
<property name="url">
<value>${jdbc.url}</value>
</property>
<property name="username">
<value>${jdbc.user}</value>
</property>
<property name="password">
<!-- value>ossserver</value-->
<value>${jdbc.password}</value>
</property>
<property name="maxActive">
<value>${jdbc.maxActive}</value>
</property>
<property name="maxIdle">
<value>${jdbc.maxIdle}</value>
</property>
<property name="maxWait">
<value>${jdbc.maxWait}</value>
</property>
</bean>
<!-- 不用事务的调用方法 -->
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" >
<property name="dataSource">
<ref bean="mydataSource"/>
</property>
<property name="mappingResources">
<list>
<value>com/eom/acl/bo/EomOrgan.hbm.xml</value>
<value>com/eom/acl/bo/EomSystemFunc.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.jdbc.fetch_size">50</prop>
<prop key="hibernate.jdbc.batch_size">30</prop>
<!-- 解决weblogic抛出的ClassNotFoundException: org.hibernate.hql.ast.HqlToken异常-->
<prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
</props>
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory"><ref bean="mySessionFactory"/></property>
</bean>
<!-- 定义业务对象-->
<bean id="EomOrganDAO"
class="com.eom.acl.daoimpl.EomOrganDAOImpl" >
<property name="sessionFactory">
<ref bean="mySessionFactory"/>
</property>
</bean>
<bean id="EomSystemFuncDAO"
class="com.eom.acl.daoimpl.EomSystemFuncDAOImpl">
<property name="sessionFactory">
<ref bean="mySessionFactory"/>
</property>
</bean>
</beans>
下面是取的两个类
package com.eom.common.context;
import java.util.Date;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class AllContext {
private static AllContext instance;
private static ApplicationContext appContext;
private static final Object key = new Object();
private AllContext()
{
if (appContext == null) {
appContext = new ClassPathXmlApplicationContext("/applicationContext.xml");
}
}
public static AllContext getInstance()
{
if (instance == null)
{
synchronized (key)
{
if (instance == null)
{
instance = new AllContext();
}
}
}
return instance;
}
public ApplicationContext getAppContext() {
return appContext;
}
}
package com.eom.common.context;
public class AppContext {
/**
* 组织机构DAO
* @return
*/
public static EomOrganDAO getEomOrganDAO(){
return (EomOrganDAO) AllContext.getInstance().getAppContext().getBean("EomOrganDAO");
}
}
不知道这样取行不行???
终于知道原因了,原来webwork 里面自带ajax 部分会影响速度