<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                Annotation: Dtd和xsd約束了xml文件的語法。這里引入了context前綴的標簽語法.用來使用注解 通過引入context標簽。運用注解來注入。請看下面的代碼案例: 詳細請看注釋 1、 Xml代碼: ~~~ <?xml version="1.0" encoding="UTF-8"?> <!-- xsd文件,約束本xml可以用的標簽 --> <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-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> <!-- 運用上面引入的命名空間標簽.初始化了4個bean 1、AutowiredAnnotationBeanPostProcessor 2、CommonAnnotationBeanPostProcessor 3、PersistenceAnnotationBeanPostProcessor 4、 RequiredAnnotationBeanPostProcessor --> <context:annotation-config/> <bean id="userDao" class="com.spring.dao.UserDaoImpl"></bean> <bean id="userService" class="com.spring.service.UserServiceImpl"> <property name="userDao" ref="userDao"></property> </bean> <bean id="userAction" class="com.spring.action.UserAction"> </bean> </beans> ~~~ 2、 Java代碼: ~~~ public class UserAction { private UserService userService; //Autowired使用的是byType類型的注入。如果配置文件中有兩個bean的話那么將出現異常 @Autowired //@Qualifier的value屬性可以指定bean的name。這樣的話就不怕配置2個bean和byName的原理一樣。@AutoWired和@Qualifier配合使用可以 public void setUserService(@Qualifier(value="userService") UserService userService) { this.userService = userService; } public void addUser(){ userService.HelloWorld(); } } ~~~ 另外還有一個注解是@Required。在這里就不多說了。其實有和沒有的意義都不是很大。大家有興趣的話可以看一看Spring的API
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看