applicationContext.xml

以下是详解Spring的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:context="http://www.springframework.org/schema/context"
     xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
         http://www.springframework.org/schema/context
         http://www.springframework.org/schema/context/spring-context-3.0.xsd">
    <bean  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:appmaster.properties</value>
</list>
</property>
</bean>
     <!--数据库配置-->
     <bean id="mongo" class="com.mongodb.Mongo" scope="singleton" lazy-init="false">
<constructor-arg index="0" type="java.lang.String" value="${mongodb.host}"/>
<constructor-arg index="1" type="int" value="${mongodb.port}"/>
</bean>  
<bean id="morphiaDataStore" class="com.babeeta.butterfly.application.management.dao.MorphiaDataStore" scope="singleton" lazy-init="false">
<property name="mongo" ref="mongo"/>
<property name="dbName" value="${mongodb.dbName}" />
<property name="mappingPackage" value="com.babeeta.butterfly.application.management.entity"/>
</bean> 

<bean id="messageDataStore" class="com.babeeta.butterfly.application.management.dao.MorphiaDataStore" scope="singleton" lazy-init="false">
<property name="mongo" ref="mongo"/>
<property name="dbName" value="${messageMongodb.dbName}" />
<property name="mappingPackage" value="com.babeeta.butterfly.application.management.entity"/>
</bean> 

    <bean id="unRegistMobileDao" class="com.babeeta.butterfly.application.management.dao.impl.UnRegistMobileDaoImpl">
       < constructor-arg  ref="morphiaDataStore"></constructor-arg> 
    </bean>    
    
   <bean id="unRegistMobileService" class="com.babeeta.butterfly.application.management.service.impl.UnRegistMobileServiceImpl">
      <property  name="unRegistMobileDao"  ref="unRegistMobileDao"></property>
    </bean>
    
   
    
 
    
    <!-- licence管理 -->
    <bean id="licenceServiceImpl" class="com.babeeta.butterfly.application.management.service.impl.LicenceServiceImpl">
        <property name="licenceDaoImpl" ref="licenceDaoImpl"></property>
        <property name="appCountHost" value="${appCountHost}"></property>
    </bean>
    <bean id="userServiceImpl" class="com.babeeta.butterfly.application.management.service.impl.UserServiceImpl">
       <property name="userDaoImpl" ref="userDaoImpl"></property>
    </bean>
    <!-- mail -->
<bean id="sendMailServiceImpl" class="com.babeeta.butterfly.application.management.service.impl.SendMailServiceImpl" scope="singleton" >
<property name="mailSender">
<bean class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="smtp.babeeta.com"> </property>
<property name="username" value="${mailUserName}"></property>
<property name="password" value="${mailPassword}"></property>
</bean>
</property>
<property name="velocityEngine">
<bean  class="org.springframework.ui.velocity.VelocityEngineFactoryBean" >
<property name="velocityProperties">
<props>
<prop key="resource.loader">class</prop>
<prop key="class.resource.loader.class">
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
</prop>
<prop key="input.encoding">utf-8</prop>
<prop key="output.encoding">utf-8</prop>
</props>
</property>
</bean>
</property>
<property name="from" value="${mailFrom}" > </property>
<property name="host" value="${host}" > </property>
<property name="resetPwdUrl" value="${resetPwdUrl}" > </property>
</bean>
    <!-- action实例 -->
      
   
    <bean id="frontAction" class="com.babeeta.butterfly.application.management.action.FrontAction">
       <property name="appServiceImpl" ref="appServiceImpl"></property>
       <property name="messageServiceImpl" ref="messageServiceImpl"></property>
       <property name="frontServiceImpl" ref="frontServiceImpl"></property>
       <property name="licenceServiceImpl" ref="licenceServiceImpl"></property>
       <property name="frontServiceImpl_2" ref="frontServiceImpl_2"/>
        <property name="unRegistMobileService" ref="unRegistMobileService"></property>
    </bean>
    </beans>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值