www

来源:互联网 发布:淘宝招牌图片更换 编辑:程序博客网 时间:2024/06/09 14:07

<?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:context="http://www.springframework.org/schema/context"
 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.xsd  http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd
           http://www.springframework.org/schema/tx
           http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
           http://www.springframework.org/schema/aop
           http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
 <bean id="myDataSource"
  class="org.apache.commons.dbcp.BasicDataSource">
  <property name="driverClassName"
   value="com.mysql.jdbc.Driver">
  </property>
  <property name="url"
   value="jdbc:mysql://121.198.247.15:3306/zks0f1_db?useUnicode=true&amp;characterEncoding=utf8">
  </property>
  <property name="username" value="zks0f1"></property>
  <property name="password" value="s5u7m3s8"></property>
  <property name="maxActive" value="1000" />
  <property name="maxIdle" value="40" />
  <property name="maxWait" value="1000" />
 </bean>
 <bean id="mySessionFactory"
  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="dataSource">
   <ref bean="myDataSource" />
  </property>
  <property name="hibernateProperties">
   <props>
    <prop key="hibernate.dialect">
     org.hibernate.dialect.MySQLDialect
    </prop>
    <prop key="hibernate.show_sql">false</prop>
   </props>
  </property>
  <property name="mappingResources">
   <list>   
    <value>com/msss/entity/CommentArticle.hbm.xml</value>
   </list>
  </property>
 </bean>
 <!-- spring email -->
 <bean id="mailSender"
  class="org.springframework.mail.javamail.JavaMailSenderImpl">
  <property name="host">
   <value>smtp.sina.com</value><!--smtp.qq.com--><!--smtp.sina.com-->
  </property>
  <property name="javaMailProperties">
   <props>
    <prop key="mail.smtp.auth">true</prop>
    <prop key="mail.smtp.timeout">25000</prop>
   </props>
  </property>
  <property name="username">
   <value>yutao15150@sina.com</value><!--meishisosuo@qq.com--><!--yutao15150@sina.com-->
  </property>
  <property name="password">
   <value>5682151</value><!--jiaguofeng--><!--5682151-->
  </property>
 </bean>
 <tx:advice id="myAdvice" transaction-manager="TransactionManager">
  <tx:attributes>
   <tx:method name="add*" propagation="REQUIRED" />
   <tx:method name="update*" propagation="REQUIRED" />
   <tx:method name="del*" propagation="REQUIRED" />
   <tx:method name="get*" propagation="REQUIRED" />
   <tx:method name="do*" propagation="REQUIRED" />
   <tx:method name="*" propagation="SUPPORTS" read-only="true" />
  </tx:attributes>
 </tx:advice>
 <aop:config>
  <aop:pointcut id="bizMethods"
   expression="execution(* com.msss.daoImpl.*.*(..))" />
  <aop:advisor advice-ref="myAdvice" pointcut-ref="bizMethods" />
 </aop:config>
 <bean id="TransactionManager"
  class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  <property name="sessionFactory" ref="mySessionFactory"></property>
 </bean>
 <!-- DAO -->
 <bean id="ScoreDAO" class="com.msss.dao.ScoreDAO">
  <property name="sessionFactory">
   <ref bean="mySessionFactory" />
  </property>
 </bean>
 <!-- BIZ -->
 <bean id="AdminBiz" class="com.msss.bizImpl.AdminBizImpl">
  <property name="adminDao" ref="AdminDAO"></property>
 </bean>
 <!-- ACTION -->
 <bean name="/shopPhoto"
  class="com.msss.struts.action.ShopPhotoAction">
  <property name="shopBiz" ref="ShopBiz"></property>
  <property name="shopPhotoBiz" ref="ShopPhotoBiz"></property>
  <property name="usersBiz" ref="UsersBiz"></property>
 </bean>
</beans>

原创粉丝点击