常用SPRING配置-------application.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-autowire="byName">
 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
  <property name="driverClassName">
   <value>com.mysql.jdbc.Driver</value>
  </property>
  <property name="url">
   <value>jdbc:mysql://hunan/netschoolforjanson?useUnicode=true&amp;characterEncoding=gbk</value>
  </property>
  <property name="username">
   <value>netschool</value>
  </property>
  <property name="password">
   <value>123456</value>
  </property>
 </bean>
 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="mappingResources">
   <list>
    <value>com/aurora/netschool/entity/Administrator.hbm.xml</value>
   。。。
    <value>com/aurora/netschool/entity/User.hbm.xml</value>
   </list>
  </property>
  <property name="hibernateProperties">
   <props>
    <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
    <prop key="hibernate.query.substitutions">true=1 false=0</prop>
    <prop key="hibernate.show_sql">false</prop>
    <prop key="hibernate.use_outer_join">true</prop>
   </props>
  </property>
  <property name="dataSource">
   <ref bean="dataSource" />
  </property>
 </bean>


 <bean name="valueListFactory" class="com.aurora.util.valuelist.ValueListFactory">
  <property name="constantsHolder">
   <value>com.aurora.netschool.Constants</value>
  </property>
 </bean>

 <bean name="configuration" class="com.aurora.Configuration" destroy-method="saveConfig">
  <property name="configureFile">
   <value>configure.properties</value>
  </property>
  <property name="directoryFile">
   <value>directory.properties</value>
  </property>
 </bean>
 <bean id="articleDao" class="com.aurora.netschool.dao.impl.ArticleDaoImpl" />
 。。。
 <bean id="cardDao" class="com.aurora.netschool.dao.impl.CardDaoImpl" />
 <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  <property name="sessionFactory">
   <ref local="sessionFactory" />
  </property>
 </bean>
 <bean id="baseTxProxy" abstract="true" lazy-init="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
  <property name="transactionAttributes">
   <props>
    <prop key="*">PROPAGATION_REQUIRED</prop>
   </props>
  </property>
  <property name="proxyTargetClass">
   <value>true</value>
  </property>
 </bean>
 <bean id="loginService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.LoginServiceImpl" />
  </property>
 </bean>
 <bean id="articleService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.ArticleServiceImpl" />
  </property>
 </bean>
 <bean id="administratorService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.AdministratorServiceImpl" />
  </property>
 </bean>
 <bean id="popedomService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.PopedomServiceImpl" />
  </property>
 </bean>
 <bean id="categoryService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.CategoryServiceImpl" />
  </property>
 </bean>
 <bean id="keyWordService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.KeyWordServiceImpl" />
  </property>
 </bean>
 <bean id="templateService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.TemplateServiceImpl" />
  </property>
 </bean>
 <bean id="specialService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.SpecialServiceImpl" />
  </property>
 </bean>
 <bean id="pageGenerationService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.PageGenerationServiceImpl" />
  </property>
 </bean>
 <bean id="commentsService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.CommentsServiceImpl" />
  </property>
 </bean>
 <bean id="commonUserService" parent="baseTxProxy">
  <property name="target">
   <bean class="com.aurora.netschool.service.impl.CommonUserServiceImpl" />
  </property>
 </bean>
 <bean id="searchEngineService" class="com.aurora.netschool.service.impl.SearchEngineServiceImpl" />

 <bean id="freemarker_cfg" class="freemarker.template.Configuration">
  <property name="dateFormat">
   <value>yyyy年MM月dd日</value>
  </property>
  <property name="dateTimeFormat">
   <value>yyyy年MM月dd日 HH点mm分</value>
  </property>
 </bean>

 <bean id="annotationConfiguration" class="org.compass.annotations.config.CompassAnnotationsConfiguration"></bean>

 <bean id="compass" class="org.compass.spring.LocalCompassBean">
  <property name="classMappings">
   <list>
    <value>com.aurora.netschool.entity.Article</value>
    <value>com.aurora.netschool.entity.Category</value>
   </list>
  </property>
  <property name="compassConfiguration" ref="annotationConfiguration" />
  <property name="compassSettings">
   <props>
    <prop key="compass.engine.connection">file://${pathIndex}</prop>
    <prop key="compass.transaction.factory">org.compass.spring.transaction.SpringSyncTransactionFactory</prop>
   </props>
  </property>
  <property name="transactionManager" ref="transactionManager" />
 </bean>

 <bean id="compassGps" class="org.compass.gps.impl.SingleCompassGps" init-method="start" destroy-method="stop" autowire="no">
  <property name="compass" ref="compass" />
  <property name="gpsDevices">
   <list>
    <bean class="org.compass.spring.device.hibernate.SpringHibernate3GpsDevice" autowire="no">
     <property name="name">
      <value>hibernateDevice</value>
     </property>
     <property name="sessionFactory" ref="sessionFactory" />
     <property name="mirrorDataChanges">
      <value>false</value>
     </property>
    </bean>
   </list>
  </property>
 </bean>

 <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="locations">
   <list>
    <value>classpath:directory.properties</value>
    <value>classpath:configure.properties</value>
   </list>
  </property>
 </bean>
 
 
 <bean id="methodInvokingJobDetail"
          class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
         <property name="targetObject"><ref bean="compassGps"/></property>
         <property name="targetMethod"><value>index</value></property>
    </bean>
    <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
          <property name="jobDetail"><ref bean="methodInvokingJobDetail"/></property>
          <property name="cronExpression"><value>${autoTime}</value></property>
    </bean>
    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" autowire="no">
            <property name="triggers"><list><ref local="cronTrigger"/></list></property>
    </bean>           

</beans>

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值