spring學習記錄

          Posted on 2007-04-07 17:30 它山の石 閱讀(301) 評論(0)  編輯  收藏
          這里只貼出XML
            1<?xml version="1.0" encoding="UTF-8"?>
            2<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
            3        "http://www.springframework.org/dtd/spring-beans.dtd">
            4<beans>
            5    <!--分散配置-->
            6    <bean id="jdbc"
            7        class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
            8        <property name="locations">
            9            <list>
           10                <value>jdbc.properties</value>
           11                <value>temp.properties</value>
           12            </list>
           13        </property>
           14    </bean>
           15    
           16    <!--自定義屬性編輯器配置器    -->
           17    <bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
           18        <property name="customEditors">
           19            <map>
           20                <entry key="com.sigon.spring.service.Address">
           21                    <bean class="com.sigon.spring.editor.AddressEditor"></bean>
           22                </entry>
           23            </map>
           24        </property>
           25    </bean>
           26<!--    國際化-->
           27    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
           28        <property name="basenames">
           29            <list>
           30                <value>jdbc</value>
           31            </list>
           32        </property>
           33    </bean>
           34<!--    注冊監聽者-->
           35<!--    <bean id="applistener" class="com.sigon.spring.listener.MyApplicationListener"/>-->
           36<!--    目標對象-->
           37    <bean id="welcomeServiceTarget" class="com.sigon.spring.service.WelcomeServiceImpl">
           38        <property name="greeting">
           39            <value>TOM</value>
           40        </property>
           41    </bean>
           42   <!--    方法前通知-->
           43    <bean id="myMethodBeforeAdvice" class="com.sigon.spring.aop.MyMethodBeforeAdvice"/>
           44    <!-- 方法后通知-->
           45    <bean id="myAfterReturningAdvice" class="com.sigon.spring.aop.MyAfterReturningAdvice"/>
           46    <!-- 環繞通知-->
           47    <bean id="myMethodInterceptor" class="com.sigon.spring.aop.MyMethodInterceptor"/>
           48<!--    代理對象-->
           49    <bean id="welcomeService" class="org.springframework.aop.framework.ProxyFactoryBean">
           50        <property name="proxyInterfaces">
           51            <list>
           52                <value>com.sigon.spring.service.WelcomeService</value>
           53                <value>com.sigon.spring.service.WelcomeService2</value>                
           54            </list>
           55        </property>
           56        <property name="interceptorNames">
           57            <list>
           58                <value>myMethodBeforeAdvice</value>
           59                <value>myAfterReturningAdvice</value>
           60                <value>myMethodInterceptor</value>
           61            </list>
           62        </property>
           63        <property name="target">
           64            <ref bean="welcomeServiceTarget"/>
           65        </property>
           66        <!--以類繼承方式-->
           67<!--        <property name="proxyTargetClass">-->
           68<!--            <value>true</value>-->
           69<!--        </property>-->
           70    </bean>
           71    
           72<!--    <bean id="welcomeSpring" class="com.sigon.spring.service.WelcomeSpring" autowire="byType">-->
           73<!--         <constructor-arg type="java.lang.String">-->
           74<!--            <value>123</value>-->
           75<!--        </constructor-arg>-->
           76<!--        <constructor-arg type="java.lang.Integer">-->
           77<!--            <value>456</value>-->
           78<!--        </constructor-arg>-->
           79<!--        <property name="homeAddress">-->
           80<!--            <value>jilin.changchun.chunchengdajie.130022</value>-->
           81<!--        </property>-->
           82<!--        <property name="comAddress">-->
           83<!--            <bean class="com.sigon.spring.service.Address">-->
           84<!--                <property name="province">-->
           85<!--                    <value>${province}</value>-->
           86<!--                </property>-->
           87<!--                <property name="city">-->
           88<!--                    <value>${city}</value>-->
           89<!--                </property>-->
           90<!--                <property name="street">-->
           91<!--                    <value>${street}</value>-->
           92<!--                </property>-->
           93<!--                <property name="zipCode">-->
           94<!--                    <value>${zipcode}</value>-->
           95<!--                </property>-->
           96<!--            </bean>-->
           97<!--        </property>-->
           98<!--        <property name="prop">-->
           99<!--            <props>-->
          100<!--                <prop key="key1">werouiq</prop>-->
          101<!--                <prop key="key2">ewlirzj;g</prop>-->
          102<!--                <prop key="key1">dsruifqweuio</prop>-->
          103<!--            </props>-->
          104<!--        </property>-->
          105<!--        <property name="welcome">-->
          106<!--            <value>${jdbc.username}</value>-->
          107<!--        </property>-->
          108<!--        <property name="map">-->
          109<!--            <map>-->
          110<!--                <entry key="key1">-->
          111<!--                    <value>skycn</value>-->
          112<!--                </entry>-->
          113<!--                <entry key="key1">-->
          114<!--                    <value>diablo</value>-->
          115<!--                </entry>-->
          116<!--                <entry key="key3">-->
          117<!--                    <ref bean="byeService"/>-->
          118<!--                </entry>-->
          119<!--                <entry key="key4">-->
          120<!--                    <value>Blizzard</value>-->
          121<!--                </entry>-->
          122<!--                <entry key="key5">-->
          123<!--                    <list>-->
          124<!--                        <value>123</value>-->
          125<!--                        <value>456</value>-->
          126<!--                        <value>789</value>-->
          127<!--                    </list>-->
          128<!--                </entry>-->
          129<!--                <entry key="key6">-->
          130<!--                    <bean class="com.sigon.spring.service.ByeService">-->
          131<!--                        <property name="bye">-->
          132<!--                            <value>UC</value>-->
          133<!--                        </property>-->
          134<!--                    </bean>-->
          135<!--                </entry>-->
          136<!--            </map>-->
          137<!--        </property>-->
          138<!--        <property name="list">-->
          139<!--            <list>-->
          140<!--                <value>tom</value>-->
          141<!--                <value>tom</value>-->
          142<!--                <value>jetta</value>-->
          143<!--                <value>1</value>-->
          144<!--                <value>1</value>-->
          145<!--                <value>2</value>-->
          146<!--                <value>2.5</value>-->
          147<!--                <bean class="com.sigon.spring.service.ByeService">-->
          148<!--                    <property name="bye">-->
          149<!--                        <value>KKK</value>-->
          150<!--                    </property>-->
          151<!--                </bean>-->
          152<!--                <ref bean="byeService"/>-->
          153<!--                <list>-->
          154<!--                    <value>123</value>-->
          155<!--                    <value>456</value>-->
          156<!--                    <ref bean="byeService"/>-->
          157<!--                </list>-->
          158<!--            </list>-->
          159<!--        </property>-->
          160<!--        <property name="is">-->
          161<!--            <list>-->
          162<!--                <value>1</value>-->
          163<!--                <value>1</value>-->
          164<!--                <value>2</value>-->
          165<!--            </list>-->
          166<!--        </property>-->
          167<!--        <property name="set">-->
          168<!--            <set>-->
          169<!--                <value>123</value>-->
          170<!--                <value>456</value>-->
          171<!--                <value>asdi</value>-->
          172<!--                <bean class="com.sigon.spring.service.ByeService"></bean>-->
          173<!--                <ref bean="byeService"/>-->
          174<!--            </set>-->
          175<!--        </property>-->
          176<!--    </bean> -->
          177<!--    <bean id="byeService" class="com.sigon.spring.service.ByeService" init-method="init">-->
          178<!--        <property name="bye">-->
          179<!--            <value>bye!!!</value>-->
          180<!--        </property>-->
          181<!--    </bean>-->
          182<!--    <bean id = "myBeanPostProcessor" class="com.sigon.spring.process.MyBeanPostProcessor"></bean>-->
          183    
          184</beans>    

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 峡江县| 四会市| 巴中市| 措勤县| 琼结县| 海门市| 雅安市| 庆城县| 保定市| 镇赉县| 中阳县| 安图县| 富阳市| 建昌县| 乌鲁木齐县| 敦煌市| 江孜县| 平远县| 晋江市| 原平市| 天台县| 府谷县| 惠州市| 金坛市| 台南市| 阳山县| 阿拉善左旗| 开鲁县| 荥经县| 观塘区| 余干县| 龙陵县| 翁牛特旗| 贵定县| 宜兰县| 中超| 常州市| 嘉善县| 四会市| 太康县| 合川市|