锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品久久久久久亚洲影视 ,久久精品国产亚洲香蕉,亚洲人成网亚洲欧洲无码久久 http://www.tkk7.com/fengliangjun/category/1647.htmlzh-cnWed, 28 Feb 2007 03:34:56 GMTWed, 28 Feb 2007 03:34:56 GMT60spring-framework-1.2.6-chapter11http://www.tkk7.com/fengliangjun/articles/26110.htmlmorcble鐨刡logmorcble鐨刡logFri, 30 Dec 2005 11:52:00 GMThttp://www.tkk7.com/fengliangjun/articles/26110.htmlhttp://www.tkk7.com/fengliangjun/comments/26110.htmlhttp://www.tkk7.com/fengliangjun/articles/26110.html#Feedback0http://www.tkk7.com/fengliangjun/comments/commentRss/26110.htmlhttp://www.tkk7.com/fengliangjun/services/trackbacks/26110.html11.2. Using the JDBC Core classes to control basic JDBC
processing and error handling

11.2.1.
鍒涘緩鏁版嵁婧愶紙鏁版嵁婧愰噷闅愯棌浜嗘暟鎹繛鎺ユ睜錛?BR>DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName( "org.hsqldb.jdbcDriver");
dataSource.setUrl( "jdbc:hsqldb:hsql://localhost:");
dataSource.setUsername( "sa");
dataSource.setPassword( "");


11.2.3. SQLExceptionTranslator
      閰嶇疆JdbcTemplate鍙婂紓甯稿鐞?BR> // create a JdbcTemplate and set data source
 JdbcTemplate jt = new JdbcTemplate();
 jt.setDataSource(dataSource);
 // create a custom translator and set the datasource for the default translation lookup
 MySQLErrorCodesTransalator tr = new MySQLErrorCodesTransalator();
 tr.setDataSource(dataSource);
 jt.setExceptionTranslator(tr);
 // use the JdbcTemplate for this SqlUpdate
 SqlUpdate su = new SqlUpdate();
 su.setJdbcTemplate(jt);
 su.setSql("update orders set shipping_charge = shipping_charge * 1.05");
 su.compile();
 su.update();

11.2.4 綆鍗曠殑璋冪敤閰嶇疆濂戒簡鐨凧dbcTemplate灝卞彲浠ユ墽琛孲QL璇彞 濡備笅

 import javax.sql.DataSource;
 import org.springframework.jdbc.core.JdbcTemplate;
 public class ExecuteAStatement {
  private JdbcTemplate jt;
  private DataSource dataSource;
  public void doExecute() {
   jt = new JdbcTemplate(dataSource);
   jt.execute("create table mytable (id integer, name varchar(100))");
  }
  public void setDataSource(DataSource dataSource) {
   this.dataSource = dataSource;
  }
 }

11.2.5. 鎵ц鏌ヨ璇彞
import javax.sql.DataSource;
import org.springframework.jdbc.core.JdbcTemplate;
 public class RunAQuery {
   private JdbcTemplate jt;
   private DataSource dataSource;
   public int getCount() {
  jt = new JdbcTemplate(dataSource);
  int count = jt.queryForInt("select count(*) from mytable");
  return count;
  }
 
 public String getName() {
   jt = new JdbcTemplate(dataSource);
   String name = (String) jt.queryForObject("select name from mytable", String.class);
   錛堟敞錛氬鏋滄洿鏂拌鍙ュ氨涔﹀啓jt.update("update mytable set name = ? where id = ?", new Object[] {name, new Integer(id)});錛?BR>   return name;
  }鈶?/FONT>

        public List getList() {
   jt = new JdbcTemplate(dataSource);
   List rows = jt.queryForList("select * from mytable");
   return rows;
 }鈶?nbsp;  錛堚憼鈶″彇鍏朵竴錛?BR> 
 public void setDataSource(DataSource dataSource) {
  this.dataSource = dataSource;
  }
}



]]>
spring-framework-1.2.6-chapter8http://www.tkk7.com/fengliangjun/articles/26109.htmlmorcble鐨刡logmorcble鐨刡logFri, 30 Dec 2005 11:49:00 GMThttp://www.tkk7.com/fengliangjun/articles/26109.htmlhttp://www.tkk7.com/fengliangjun/comments/26109.htmlhttp://www.tkk7.com/fengliangjun/articles/26109.html#Feedback0http://www.tkk7.com/fengliangjun/comments/commentRss/26109.htmlhttp://www.tkk7.com/fengliangjun/services/trackbacks/26109.html8.2. Transaction strategies
1銆備嬌鐢⊿PRING騫沖彴浜嬪姟綆$悊鍣?/FONT>

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="${jdbc.driverClassName}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>
The PlatformTransactionManager definition will look like this:
<bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>

浣跨敤JTA浜嬪姟綆$悊鍣?BR>If we use JTA, as in the dataAccessContext-jta.xml file from the same sample application, we need to use a
container DataSource, obtained via JNDI, and a JtaTransactionManager implementation. The
JtaTransactionManager doesn't need to know about the DataSource, or any other specific resources, as it will
use the container's global transaction management.

<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/jpetstore"/>>
</bean>
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>

浠ヤ笂涓ょ鏂規硶瀹炵幇鐨勫姛鑳芥槸絳夋晥鐨勩?/FONT>

2銆傛妸hibernate鍜宻pring緇撳悎璧鋒潵
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
    <property name="dataSource" ref="dataSource"/>
    <property name="mappingResources">
       <list>
           <value>org/springframework/samples/petclinic/hibernate/petclinic.hbm.xml</value>
       </list>
    </property>
    <property name="hibernateProperties">
       <props>
           <prop key="hibernate.dialect">${hibernate.dialect}</prop>
       </props>
    </property>
</bean>
<bean id="txManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">鈶狅紙灞閮ㄤ簨鍔★級
     <property name="sessionFactory" ref="sessionFactory"/>
</bean>


鈶犲With Hibernate and JTA transactions we could simply use the JtaTransactionManager as with JDBC or any
other resource strategy.
<bean id="txManager" class="org.springframework.transaction.jta.JtaTransactionManager"/>錛圝TA涓哄叏灞浜嬪姟錛?/FONT>


澹版槑寮忎簨鍔$鐞?BR><!-- this example is in verbose form, see note later about concise for multiple proxies! -->
<!-- the target bean to wrap transactionally -->
<bean id="petStoreTarget">
 ...
</bean>
<bean id="petStore" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
 <property name="transactionManager" ref="txManager"/>
 <property name="target" ref="petStoreTarget"/>
 <property name="transactionAttributes">
   <props>
      <prop key="insert*">PROPAGATION_REQUIRED,-MyCheckedException</prop>
      <prop key="update*">PROPAGATION_REQUIRED</prop>
      <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
   </props>
 </property>
</bean>



]]>
spring-framework-1.2.6-chapter3http://www.tkk7.com/fengliangjun/articles/25774.htmlmorcble鐨刡logmorcble鐨刡logWed, 28 Dec 2005 11:38:00 GMThttp://www.tkk7.com/fengliangjun/articles/25774.htmlhttp://www.tkk7.com/fengliangjun/comments/25774.htmlhttp://www.tkk7.com/fengliangjun/articles/25774.html#Feedback0http://www.tkk7.com/fengliangjun/comments/commentRss/25774.htmlhttp://www.tkk7.com/fengliangjun/services/trackbacks/25774.html鏈鍩虹鐨勫寘涓湁涓や釜鏄痮rg.springframework.beans 鍜宱rg.springframework.context .榪欎袱涓寘鎻愪緵浜唖pring渚濊禆娉ㄥ皠鍔熻兘鐨勫熀紜銆?BR>BeanFactory鎻愪緵浜嗛珮綰х殑閰嶇疆鏈哄埗鐢ㄤ簬綆$悊beans銆?BR>ApplicationContext鎺ュ彛寤虹珛鍦˙eanFactory鎺ュ彛涔嬩笂錛圔eanFactory鐨勫瓙綾伙級錛屽張娣誨姞浜嗗叾瀹冪殑鍔熻兘錛屾瘮濡傦細鏇村鏄撲笌Spring AOP鍔熻兘緇撳悎錛屼俊鎭祫婧愬鐞嗭紝浜嬩歡浼犳挱錛屽緩绔婣pplicationContext鍜岀埗Contexts鐨勬満鍒訛紝搴旂敤灞傜壒孌婄殑context錛堝WebApplicationContext錛夈?BR>ApplicationContext鏄疊eanFactory鐨勬墿灞曪紝鎵鏈塀eanFactory鐨勫姛鑳介兘鑳藉湪ApplicationContext涓疄鐜般傚湪寤虹珛鐨勯」鐩浜巎2ee鐜鐨勬椂鍊欐渶濂介夋嫨ApplicationContext錛涘綋浣犲鍐呭瓨鐨勫崰鏈夊緢鍏沖績鐨勬椂鍊欙紙濡備竴涓猘pplet浼氬叧蹇冩瘡KB澶у皬錛夊彲浠ラ夋嫨BeanFactory錛堝崰鍐呭瓨灝戯級銆?BR>BeanFactory 鏄負浜嗚闂甋pring bean container錛屽彲浠ユ妸瀹冪湅鎴愪簨瀹炰笂鐨刢ontainer.涓鑸畝鍗曠殑BeanFactory鐨勫疄鐜版槸org.springframework.beans.factory.xml.XmlBeanFactory銆?BR>鍒涘緩 BeanFatory鐨?涓姙娉曞涓?nbsp;
1銆俁esource res = new FileSystemResource("beans.xml");
   XmlBeanFactory factory = new XmlBeanFactory(res);
2銆侰lassPathResource res = new ClassPathResource("beans.xml");
   XmlBeanFactory factory = new XmlBeanFactory(res);
3銆侰lassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(new String[] {"applicationContext.xml", "applicationContext-part2.xml"});
      // of course, an ApplicationContext is just a BeanFactory
   BeanFactory factory = (BeanFactory) appContext;
   錛堟敞錛歱ublic interface Resourceextends InputStreamSource錛?BR>        public interface InputStreamSource錛?BR>澶氭暟鐢ㄦ硶涓紝鐢ㄦ埛涓嶉渶瑕佺紪鍐欎唬鐮佸垵濮嬪寲BeanFactory 鎴?ApplicationContext錛屽洜涓篠pring妗嗘灦浼氳嚜鍔ㄥ畬鎴愩備緥濡傦細鍦╳eb灞傛彁渚涗簡浠g爜鑷姩瑁呰澆
ApplicationContext錛屼綔涓烘甯哥殑j2eeWEB搴旂敤紼嬪簭寮濮嬬殑涓閮ㄥ垎銆?BR> 

 閰嶇疆bean鐨刋ML鍑犵鏍煎紡濡備笅錛?BR> (1)銆傞氳繃鏋勯犲嚱鏁板垱寤篵ean錛宐ean鍙互鏄痡avabean 涔熷彲浠ヤ笉鏄紝涔熶笉鐢ㄥ疄鐜板埆鐨勬帴鍙c?BR>    <bean id="exampleBean" class="examples.ExampleBean"/>
    <bean name="anotherExample" class="examples.ExampleBeanTwo"/>
    濡傛灉浣犻渶瑕佸疄鐜癐OC鏈哄埗錛屼綘鐨刡ean闇瑕佷竴涓粯璁ょ殑絀哄弬鏁版瀯閫犲嚱鏁般?BR> (2)銆傞氳繃闈欐佸伐鍘傚嚱鏁板垱寤篵ean.
   <bean id="exampleBean" class="examples.ExampleBean2"
     factory-method="createInstance"/>
      createInstance鏄痚xamples.ExampleBean2鐨勯潤鎬佸伐鍘傛柟娉曪紝鐢ㄤ簬鐢熸垚exampleBean銆?BR> (3).閫氳繃瀹炰緥宸ュ巶鏂規硶鍒涘緩bean.
 <!-- The factory bean, which contains a method called createInstance -->
  <bean id="myFactoryBean" class="...">
  ...
   </bean>
   <!-- The bean to be created via the factory bean -->
  <bean id="exampleBean" factory-bean="myFactoryBean" factory-method="createInstance"/>


To singleton or not to singleton
<bean id="exampleBean"
class="examples.ExampleBean" singleton="false"/>
<bean name="yetAnotherExample"
class="examples.ExampleBeanTwo" singleton="true"/>


鍑犵渚濊禆娉ㄥ皠鏍煎紡
(1)setter娉ㄥ皠

<bean id="exampleBean" class="examples.ExampleBean">
<property name="beanOne"><ref bean="anotherExampleBean"/></property>
<property name="beanTwo"><ref bean="yetAnotherBean"/></property>
<property name="integerProperty"><value>1</value></property>
</bean>
<bean id="anotherExampleBean" class="examples.AnotherBean"/>
<bean id="yetAnotherBean" class="examples.YetAnotherBean"/>
public class ExampleBean {
private AnotherBean beanOne;
private YetAnotherBean beanTwo;
private int i;

public void setBeanOne(AnotherBean beanOne) {
this.beanOne = beanOne;
}
public void setBeanTwo(YetAnotherBean beanTwo) {
this.beanTwo = beanTwo;
}
public void setIntegerProperty(int i) {
this.i = i;
}
}

(2)鏋勯犲嚱鏁版敞灝?BR><bean id="exampleBean" class="examples.ExampleBean">
<constructor-arg><ref bean="anotherExampleBean"/></constructor-arg>
<constructor-arg><ref bean="yetAnotherBean"/></constructor-arg>
<constructor-arg type="int"><value>1</value></constructor-arg>
</bean>
<bean id="anotherExampleBean" class="examples.AnotherBean"/>
<bean id="yetAnotherBean" class="examples.YetAnotherBean"/>
public class ExampleBean {
private AnotherBean beanOne;
private YetAnotherBean beanTwo;
private int i;
public ExampleBean(AnotherBean anotherBean, YetAnotherBean yetAnotherBean, int i) {
this.beanOne = anotherBean;
this.beanTwo = yetAnotherBean;
this.i = i;
}
}

(3)闈欐佸伐鍘傛敞灝?BR><bean id="exampleBean" class="examples.ExampleBean" factory-method="createInstance">
<constructor-arg><ref bean="anotherExampleBean"/></constructor-arg>
<constructor-arg><ref bean="yetAnotherBean"/></constructor-arg>
<constructor-arg><value>1</value></constructor-arg>
</bean>
<bean id="anotherExampleBean" class="examples.AnotherBean"/>
<bean id="yetAnotherBean" class="examples.YetAnotherBean"/>

public class ExampleBean {
 ...
 // a private constructor
   private ExampleBean(...) {
   ...
   }
 // a static factory method
 // the arguments to this method can be considered the dependencies of the bean that
 // is returned, regardless of how those arguments are actually used.
     public static ExampleBean createInstance(AnotherBean anotherBean, YetAnotherBean yetAnotherBean, int i) {
        ExampleBean eb = new ExampleBean(...);
       // some other operations
        ...
      return eb;
     }
}


鏋勯犲嚱鏁伴厤緗殑鍙︿竴縐嶆牸寮?BR><bean id="exampleBean" class="examples.ExampleBean">
<constructor-arg index="0"><value>7500000</value></constructor-arg>
<constructor-arg index="1"><value>42</value></constructor-arg>
</bean>
鍙互鍦ㄩ厤緗枃浠朵腑鍔犲叆楠岃瘉鏁版嵁鐨勭被鍨?濡備笅
<bean id="exampleBean" class="examples.ExampleBean">
<constructor-arg index="0" type="int"><value>7500000</value></constructor-arg>
<constructor-arg index="1" type="java.lang.String"><value>42</value></constructor-arg>
</bean>

涓鑸睘鎬ч厤緗牸寮?BR><bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<!-- results in a setDriverClassName(String) call -->
  <property name="driverClassName">
     <value>com.mysql.jdbc.Driver</value>
  </property>
  <property name="url">
     <value>jdbc:mysql://localhost:3306/mydb</value>
  </property>
  <property name="username">
     <value>root</value>
  </property>
</bean>

娉ㄦ剰錛?lt;value></value> 榛樿涓虹┖瀛楃涓詫紝


灞炴ull鐨勬牸寮忓涓?BR><bean class="ExampleBean">
 <property name="email"><null/></property>
</bean>


灞炴ollection鐨勬牸寮忓涓?BR><bean id="moreComplexObject" class="example.ComplexObject">
<!-- results in a setPeople(java.util.Properties) call -->
<property name="people">
   <props>
     <prop key="HarryPotter">The magic property</prop>
     <prop key="JerrySeinfeld">The funny property</prop>
   </props>
</property>
<!-- results in a setSomeList(java.util.List) call -->
<property name="someList">
   <list>
     <value>a list element followed by a reference</value>
     <ref bean="myDataSource"/>
   </list>
</property>
<!-- results in a setSomeMap(java.util.Map) call -->
<property name="someMap">
   <map>
     <entry>
         <key><value>yup an entry</value></key>
         <value>just some string</value>
     </entry>
     <entry>
         <key><value>yup a ref</value></key>
         <ref bean="myDataSource"/>
     </entry>
  </map>
</property>
<!-- results in a setSomeSet(java.util.Set) call -->
 <property name="someSet">
   <set>
     <value>just some string</value>
     <ref bean="myDataSource"/>
   </set>
 </property>
</bean>

3.3.3.4. Inner bean definitions via nested bean elements
<bean id="outer" class="...">
<!-- Instead of using a reference to target, just use an inner bean -->
   <property name="target">
      <bean class="com.mycompany.PersonImpl">//宓屽鐨刡ean涓嶉渶瑕乮d
         <property name="name"><value>Tony</value></property>
         <property name="age"><value>51</value></property>
      </bean>
   </property>
</bean>

澶嶅悎灞炴у畾涔?BR><bean id="foo" class="foo.Bar">
<property name="fred.bob.sammy" value="123"/> 灞炴red涓嬫湁灞炴ob,bob灞炴т笅鏈塻ammy 鎶妔ammy緗負123銆?BR></bean>

3.3.4. Method Injection錛堟柟娉曟敞灝勶級
<!-- a stateful bean deployed as a prototype (non-singleton) -->
<bean id="singleShotHelper class="..." singleton="false">
</bean>
<!-- myBean uses singleShotHelper -->
<bean id="myBean" class="...">
   <lookup-method name="createSingleShotHelper" bean="singleShotHelper"/>
   <property>
   ...
   </property>
</bean>
鎴戠殑鐞嗚В錛歮yBean 涓繀欏誨疄鐜?protected [abstract] SingleShotHelper createSingleShotHelper();
singleShotHelper涓繀欏誨疄鐜?protected  SingleShotHelper createSingleShotHelper();
榪愯鏃?nbsp; singleShotHelper鐨刢reateSingleShotHelper浼氳鐩杕yBean鐨刢reateSingleShotHelper銆?/鏈獙璇?/FONT>

3.3.4.2. Arbitrary method replacement錛堜換鎰忕殑鏂規硶鏇挎崲錛?BR>public class MyValueCalculator {
     public String computeValue(String input) {
     ... some real code
     }
     ... some other methods
  }

榪涜鏇挎崲鐨勭被蹇呴』瀹炵幇鎺ュ彛org.springframework.beans.factory.support.MethodReplacer
public class ReplacementComputeValue implements MethodReplacer {
   public Object reimplement(Object o, Method m, Object[] args) throws Throwable {
  // get the input value, work with it, and return a computed result
   String input = (String) args[0];
   ...
   return ...;
  }
}

<bean id="myValueCalculator class="x.y.z.MyValueCalculator">
<!-- arbitrary method replacement -->
    <replaced-method name="computeValue" replacer="replacementComputeValue">
       <arg-type>String</arg-type>     榪欓噷琛ㄧず鏂規硶鎺ュ彈鐨勫弬鏁幫紝鏈夊嚑涓垪鍑犱釜銆?BR>    </replaced-method>                 榪欐牱myValueCalculator涓殑computeValue鏂規硶灝辮鏇挎崲浜?BR></bean>
<bean id="replacementComputeValue" class="a.b.c.ReplaceMentComputeValue"/>


3.4.1鐢熷懡鍛ㄦ湡
<bean id="exampleInitBean" class="examples.ExampleBean" init-method="init"/>
public class ExampleBean {
   public void init() {
    // do some initialization work
   }
}
Is exactly the same as:
<bean id="exampleInitBean" class="examples.AnotherExampleBean"/>
  public class AnotherExampleBean implements InitializingBean {
  public void afterPropertiesSet() {
  // do some initialization work
  }
}


<bean id="exampleInitBean" class="examples.ExampleBean" destroy-method="cleanup"/>
public class ExampleBean {
    public void cleanup() {
   // do some destruction work (like closing connection)
   }
}
Is exactly the same as:
<bean id="exampleInitBean" class="examples.AnotherExampleBean"/>
    public class AnotherExampleBean implements DisposableBean {
    public void destroy() {
      // do some destruction work
    }
}

 

===============================================
3.7. 鐢˙eanPostProcessors鑷畾涔塨eans
   ConfigurableBeanFactory bf = new .....; // create BeanFactory
    ... // now register some beans
   // now register any needed BeanPostProcessors
    MyBeanPostProcessor pp = new MyBeanPostProcessor();
   bf.addBeanPostProcessor(pp);
   // now start using the factory

3.8. 鐢˙eanFactoryPostProcessors 鑷畾涔塨ean factories
   XmlBeanFactory factory = new XmlBeanFactory(new FileSystemResource("beans.xml"));
     // create placeholderconfigurer to bring in some property
     // values from a Properties file
   PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
   cfg.setLocation(new FileSystemResource("jdbc.properties"));
   // now actually do the replacement
   cfg.postProcessBeanFactory(factory);
錛堜篃鍙互澹版槑寮忓畾涔?BR>   <!-- property placeholder post-processor -->
        <bean id="placeholderConfig"  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
             <property name="location" value="jdbc.properties"/>
        </bean>
錛?/FONT>

鐢變笂
浠ヤ笅榪欎釜澶勪簬beanfactory瀹瑰櫒閲岀殑鏁版嵁婧愬氨鎸塲dbc.properties閲岀殑閰嶇疆浜?BR><bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
  <property name="driverClassName" value="${jdbc.driverClassName}"/>
  <property name="url" value="${jdbc.url}"/>
  <property name="username" value="${jdbc.username}"/>
  <property name="password" value="${jdbc.password}"/>
</bean>

鍏朵腑jdbc.properties濡備笅
jdbc.driverClassName=org.hsqldb.jdbcDriver
jdbc.url=jdbc:hsqldb:hsql://production:9002
jdbc.username=sa
jdbc.password=root


3.8.2. The PropertyOverrideConfigurer

3.19. Creating an ApplicationContext from a web application
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/daoContext.xml /WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>錛坱he listener cannot be used in Servlet 2.2 compatible
containers  浣嗘槸鍦⊿ervlet2.4鍚庨兘鏅亶閲囩敤瀹冿級

<!-- OR USE THE CONTEXTLOADERSERVLET INSTEAD OF THE LISTENER
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
-->



]]>
spring-framework-1.2.6-chapter1http://www.tkk7.com/fengliangjun/articles/25691.htmlmorcble鐨刡logmorcble鐨刡logWed, 28 Dec 2005 04:14:00 GMThttp://www.tkk7.com/fengliangjun/articles/25691.htmlhttp://www.tkk7.com/fengliangjun/comments/25691.htmlhttp://www.tkk7.com/fengliangjun/articles/25691.html#Feedback0http://www.tkk7.com/fengliangjun/comments/commentRss/25691.htmlhttp://www.tkk7.com/fengliangjun/services/trackbacks/25691.htmlspring 鐢?涓ā鍧楃粍鎴愩?BR>1銆侰ore package 鏄痵pring妗嗘灦鏈鍩虹鐨勫寘銆傚畠鎻愪緵浜嗕緷璧栨敞灝勬満鍒訛紝璁╀綘鑳藉閫氳繃璋冪敤鍑芥暟綆$悊bean瀹瑰櫒銆傝繖閲屾渶鍩虹鐨勬蹇墊槸BeanFactory錛坧ublic interface BeanFactory錛夛紝瀹冨彲浠ラ氳繃宸ュ巶妯″紡鍒涘緩singletons錛屼笉鍐嶉渶瑕佷綘鑷繁緙栫▼瀹炵幇錛涘茍涓斿彲浠ヨВ鑰︿綘鐨勫疄闄呯▼搴忕殑涓氬姟閫昏緫銆?BR>2銆侰ontext package 鎻愪緵浜嗘鏋跺紡璁塊棶beans鐨勬柟娉曪紝綾諱技JNDI-registry銆傚畠緇ф壙浜咮eans鍖呯殑鍔熻兘錛屽茍娣誨姞浜嗘敮鎸佹枃鏈俊鎭殑鍙戦佺殑鍔熻兘錛屼緥濡傦細璧勬簮鎹嗙粦錛屼簨浠朵紶鎾紝璧勬簮瑁呰澆鍜岄忔槑鐨勪笂涓嬫枃鍒涘緩銆傚叿浣撳簲鐢ㄥ疄渚嬪servlet瀹瑰櫒銆?BR>3銆侱AO package 鎻愪緵浜嗕竴涓彁鍙栦簡jdbc鐨勫眰錛岃浣犱笉蹇呯紪鍐欎箯鍛崇殑jdbc浠g爜錛屼笉蹇呰冭檻鍥犱笉鍚屾暟鎹簱鐨勪唬鐮佸樊寮傝屽甫鏉ョ殑閿欒銆俲dbc鍖咃紙org.springframework.jdbc錛夋彁渚涗簡涓涓0鏄庡紡錛堝湪xml閰嶇疆鏂囦歡涓鏄庯級鐨勪簨鍔$鐞嗭紝涓嶄粎閽堝瀹炵幇鐗瑰畾鎺ュ彛鐨勭被鏈夌敤錛岃屼笖瀵規墍鏈夌殑POJOs (plain old java objects)銆?BR>4銆侽RM package 閽堝鐩墠嫻佽鐨勫璞″叧緋繪槧灝凙PIS鎻愪緵浜嗗涓患鍚堢殑灞傦紝鍏朵腑鍖呮嫭浜咼DO,Hibernate鍜宨Batis.浣跨敤榪欎釜鍖呬綘鍙互鎶婁互涓?涓狾/R-mappers緇撳悎Spring鎻愪緵鐨勬墍鏈夊姛鑳斤紝濡傚墠闈㈡彁鍒扮殑綆鍗曞0鏄庡紡鐨勪簨鍔$鐞嗐?BR>5銆侫OP package 璁╀綘鍙互瀹氫箟絎﹀悎AOP鑱旂洘瑙勮寖鐨勶紙AOP瑙勮寖緇勭粐錛夐潰鍚戦潰緙栫▼鐨勫叿浣撳疄鐜幫紝濡?鏂規硶鎷︽埅鍜屽垏鐐癸紝騫插噣鐨勭粰浠庨昏緫璇村簲璇ヨ鍒嗙鐨勫姛鑳藉疄鐜頒唬鐮佽В鑰︺備嬌鐢ㄦ簮鐮佺駭鐨勫厓鏁版嵁鍔熻兘錛屼綘鍙互鎶婂悇縐嶈涓轟俊鎭茍鍏ヤ綘鐨勪唬鐮佷腑銆?BR>6銆俉eb package 鎻愪緵浜嗗熀紜鐨剋eb鍔熻兘錛屽multipart鍔熻兘錛屼嬌鐢╯ervlet listeners鍒濆鍖朿ontexts銆傚紩瀵紈eb鐨刟pplication context銆傚湪浣跨敤spring鍜學ebWork鎴栬匰truts闆嗘垚鐨勬椂鍊欓渶瑕佹暣鍚堣繖涓寘銆?BR>7銆俉eb MVC package 鎻愪緵浜嗛拡瀵箇eb紼嬪簭鐨凪VC瀹炵幇銆傚畠鎻愪緵浜嗕竴涓竻鏅扮殑model鍜寃eb forms鐨勫垎紱伙紝騫跺厑璁鎬綘浣跨敤鎵鏈夊叾瀹冪殑spring妗嗘灦鐨勫姛鑳斤紝濡傛湁鏁堟ч獙璇侊紙鐢ㄦ埛鎻愪氦鐨勪俊鎭紜笌鍚︾殑楠岃瘉錛夈?/FONT>



]]>
主站蜘蛛池模板: 99免费观看视频| 日韩精品电影一区亚洲| 久久WWW免费人成人片| 五月婷婷亚洲综合| 国产AV无码专区亚洲AV麻豆丫| 国产在线精品观看免费观看 | 国产av天堂亚洲国产av天堂| 亚洲视频一区在线| 一级毛片**免费看试看20分钟| 999国内精品永久免费观看| 超清首页国产亚洲丝袜| 久久久久久亚洲av无码蜜芽| 成人性生交大片免费看好| 免费欧洲毛片A级视频无风险| 亚洲不卡1卡2卡三卡2021麻豆| 国产日韩久久免费影院| 成人午夜免费福利| 午夜一级免费视频| 国产成人精品久久亚洲高清不卡| 亚洲国产专区一区| 牛牛在线精品免费视频观看| 3d动漫精品啪啪一区二区免费| 亚洲男人的天堂一区二区| 美女被免费视频网站a| 久久伊人亚洲AV无码网站| 久章草在线精品视频免费观看| 天堂亚洲免费视频| 成人片黄网站色大片免费观看APP| 亚洲AV无码久久精品色欲| 中文字幕免费在线视频| 久久亚洲日韩精品一区二区三区| 国产高清视频免费在线观看| 亚洲第一成人影院| 国产精品无码亚洲精品2021| 亚洲日韩在线观看| 一级毛片免费播放视频| 99久久精品国产亚洲| 日本人护士免费xxxx视频| 久久精品国产亚洲av瑜伽| 亚洲午夜精品一级在线播放放 | 国产免费福利体检区久久|