锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲综合精品网站,亚洲av日韩av综合,亚洲精品你懂的在线观看http://m.tkk7.com/vcycyv/category/47722.htmlzh-cnMon, 14 Mar 2011 03:46:27 GMTMon, 14 Mar 2011 03:46:27 GMT60鎬葷粨Spring Security涔?鍏充簬鎺堟潈錛屼繚鎶eb鍜屼繚鎶ゆ柟娉?/title><link>http://m.tkk7.com/vcycyv/archive/2011/03/14/346178.html</link><dc:creator>浜哄湪姹熸箹</dc:creator><author>浜哄湪姹熸箹</author><pubDate>Mon, 14 Mar 2011 00:41:00 GMT</pubDate><guid>http://m.tkk7.com/vcycyv/archive/2011/03/14/346178.html</guid><wfw:comment>http://m.tkk7.com/vcycyv/comments/346178.html</wfw:comment><comments>http://m.tkk7.com/vcycyv/archive/2011/03/14/346178.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/vcycyv/comments/commentRss/346178.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/vcycyv/services/trackbacks/346178.html</trackback:ping><description><![CDATA[     鎽樿: 鎺ヤ笂涓綃?鎬葷粨Spring Security涔?鍏充簬Authentication * 鍏充簬鎺堟潈 AcessDecisionManager鏄鎺堟潈鐨勩傚叿浣撴巿鏉冿紙authorization錛夌殑宸ヤ綔鏄氦緇欎竴緋誨垪Voter鏉ュ仛鐨勩傛瘡涓猇oter閮藉疄鐜癆ccessDecisionVoter鎺ュ彛鐨剉ote鏂規(guī)硶錛岃繑鍥?int ACCESS_GRANTED = 1;錛堟姇璧炴垚紲級(jí) int ACCESS_ABSTA...  <a href='http://m.tkk7.com/vcycyv/archive/2011/03/14/346178.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/vcycyv/aggbug/346178.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/vcycyv/" target="_blank">浜哄湪姹熸箹</a> 2011-03-14 08:41 <a href="http://m.tkk7.com/vcycyv/archive/2011/03/14/346178.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎬葷粨Spring Security涔?鍏充簬Authenticationhttp://m.tkk7.com/vcycyv/archive/2011/03/08/345922.html浜哄湪姹熸箹浜哄湪姹熸箹Tue, 08 Mar 2011 03:02:00 GMThttp://m.tkk7.com/vcycyv/archive/2011/03/08/345922.htmlhttp://m.tkk7.com/vcycyv/comments/345922.htmlhttp://m.tkk7.com/vcycyv/archive/2011/03/08/345922.html#Feedback0http://m.tkk7.com/vcycyv/comments/commentRss/345922.htmlhttp://m.tkk7.com/vcycyv/services/trackbacks/345922.html鍓嶈█
寮濮嬭姳浜?jiǎn)涓や笁澶╃殑鏃堕棿瀛pring Security錛岃繕鏄簯灞遍浘緗╃殑錛屽ぇ鍙楁墦鍑匯備簬鏄噸鏂版葷粨涓涓嬶紝椋炶秺榪烽浘錛屾⒊鐞嗘濊礬錛屽啓榪欐牱涓綃囨枃瀛椼傜綉涓婃湁涓浄閿嬪啓浜?jiǎn)Spring Security2 瀛︿範(fàn)綺捐錛歨ttp://www.javaeye.com/topic/319965閲岄潰鍖呭惈鍙互榪愯鐨勪唬鐮侊紝濡傛灉浣犲spring scurity鎰熷叴瓚o紝鍙互蹇熸祻瑙堜竴涓嬩笅闈㈢殑絎旇錛岀劧鍚巇ebug code錛岀劧鍚庡啀鐪嬬湅絎旇銆係pring Security鐨勫唴瀹硅繙姣旂瑪璁板鏉傦紝鎴戝彧鏄牴鎹嚜宸辯殑鐞嗚В鎸?xiě)閲嶈鐨勮褰曭q舵暣鐞嗕竴涓嬨傛妸sample code涔熷綋浣滅瑪璁扮殑涓閮ㄥ垎錛岄偅涓猚ode榪樻槸姣旇緝綺劇畝鍦幫紝鏇撮噸瑕佺殑鏄疄鐢ㄣ?br /> 瀹樻柟鎻愪緵鐨剆ample code鍖呭眳鐒舵病鏈夋簮浠g爜錛宖aint錛?google鍗婂ぉ鎵懼埌http://grepcode.com/snapshot/repo1.maven.org/maven2/org.springframework.security/spring-security-samples-contacts/2.0.0 褰撶劧錛屽鏋滀綘浼?xì)鐢╣it鐨勮瘽涔熷彲浠ヨ嚜宸眂heck out code, 涓嶈繃鎴戞病鐢ㄨ繃git榪欑楂樼駭璐с?br />
姝f枃
璺熸潈闄愭湁鍏崇殑涓や釜姒傚康鏄?璁よ瘉 鍜?鎺堟潈錛?鍏堜笂涓浘錛?/p>

image

Run-As Manager 鍜?After-Invocation Manager涓嶉噸瑕?/p>

The  actual  implementation  of  a  security  interceptor  will  depend  on  what resource is being secured. If you’re securing a URL in a web application, the security  interceptor  will  be  implemented  as  a  servlet  filter.  But  if  you’re  securing  a method invocation, aspects will be used to enforce security.

榪欑瘒鍙Authentication Manager:

璁よ瘉鏄氳繃AuthenticationManager鏉ョ鐨勶紝

public interface AuthenticationManager {
  public Authentication authenticate(Authentication authentication)
      throws AuthenticationException;

}

The  authenticate()  method  will  attempt  to  authenticate  the  user  using  the org.acegisecurity.Authentication object (which carries the principal and credentials). If successful, the authenticate() method returns a complete Authentication  object,  including  information  about  the  user’s  granted  authorities (which will be considered by the authorization manager).

鍏蜂綋鐨勫伐浣滄槸浜ょ粰鍚勪釜 authentication provider鏉ュ仛鐨勶細(xì)

image

榪欓噷provider manager鍖呭惈澶氫釜鍏蜂綋鐨刾roviders:

<bean id="authenticationManager"
    class="org.acegisecurity.providers.ProviderManager">
  <property name="providers">
    <list>
      <ref bean="daoAuthenticationProvider"/>
      <ref bean="ldapAuthenticationProvider"/>
    </list>
  </property>
</bean>
ProviderManager is given its list of authentication providers through its providers property.

浠aoAuthenticationProvider涓句緥錛?

<bean id="authenticationProvider"
    class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
  <property name="userDetailsService"
      ref="userDetailsService"/>
</bean>

瀹冧細(xì)瑕佹眰涓涓猆serDetailsService, 璺熷畠鐩稿叧鐨勬槸UserDetails鎺ュ彛

UserDetailsService鎺ュ彛鏄釜綆鍗曠殑鎺ュ彛

public interface UserDetailsService {
    UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException;
}

 

UserDetails鎺ュ彛濡備笅錛?

public interface UserDetails extends Serializable {
    GrantedAuthority[] getAuthorities();

    String getPassword();

    String getUsername();

    boolean isAccountNonExpired();

    boolean isAccountNonLocked();

    boolean isCredentialsNonExpired();

    boolean isEnabled();
}

瑙i噴涓涓媑etAuthorities:璇ユ柟娉曡繑鍥炰竴涓狦rantedAuthority[]鏁扮粍瀵硅薄錛孏rantedAuthority鏄敤鎴鋒潈闄愪俊鎭璞★紝榪欎釜瀵硅薄涓畾涔変簡(jiǎn)涓涓幏鍙栫敤鎴鋒潈闄愭弿榪頒俊鎭殑getAuthority()鏂規(guī)硶銆?

闇瑕佹敞鎰?em>Authentication瀵硅薄鎵嶆槸Spring Security浣跨敤鐨勮繘琛屽畨鍏ㄨ闂帶鍒剁敤鎴蜂俊鎭畨鍏ㄥ璞°傚疄闄呬笂錛孉uthentication瀵硅薄鏈夋湭璁よ瘉鍜屽凡璁よ瘉涓ょ鐘舵侊紝鍦ㄤ綔涓哄弬鏁頒紶鍏ヨ璇佺鐞嗗櫒錛圓uthenticationManager錛夌殑authenticate鏂規(guī)硶鏃訛紝鏄竴涓湭璁よ瘉鐨勫璞★紝瀹冧粠瀹㈡埛绔幏鍙栫敤鎴風(fēng)殑韜喚淇℃伅錛堝鐢ㄦ埛鍚嶏紝瀵嗙爜錛夛紝鍙互鏄粠涓涓櫥褰曢〉闈紝涔熷彲浠ヤ粠Cookie涓幏鍙栵紝騫剁敱緋葷粺鑷姩鏋勯犳垚涓涓狝uthentication瀵硅薄銆傝岃繖閲屾彁鍒扮殑UserDetails浠h〃涓涓敤鎴峰畨鍏ㄤ俊鎭殑婧愶紙浠庢暟鎹簱錛孡DAP鏈嶅姟鍣紝CA涓績(jī)榪斿洖錛夛紝Spring Security瑕佸仛鐨勫氨鏄皢榪欎釜鏈璇佺殑Authentication瀵硅薄鍜孶serDetails榪涜鍖歸厤錛屾垚鍔熷悗灝哢serDetails涓殑鐢ㄦ埛鏉冮檺淇℃伅鎷瘋礉鍒癆uthentication涓粍鎴愪竴涓畬鏁寸殑Authentication瀵硅薄錛屽叡鍏跺畠緇勪歡鍏變韓銆?

 
涓嬩竴綃囷細(xì) 鎬葷粨Spring Security涔?鍏充簬鎺堟潈錛屼繚鎶eb鍜屼繚鎶ゆ柟娉?/u> 
 

鍙傝冿細(xì)

Spring in Action

Spring Security瀛︿範(fàn)鎬葷粨錛?http://m.tkk7.com/redhatlinux/archive/2008/08/20/223148.html

Spring Security2 瀛︿範(fàn)綺捐錛?http://www.javaeye.com/topic/319965



]]>
璇︾粏璁茶В鍦⊿pring涓繘琛岄泦鎴愭祴璇曪紙杞級(jí)http://m.tkk7.com/vcycyv/archive/2011/02/24/345040.html浜哄湪姹熸箹浜哄湪姹熸箹Thu, 24 Feb 2011 02:12:00 GMThttp://m.tkk7.com/vcycyv/archive/2011/02/24/345040.htmlhttp://m.tkk7.com/vcycyv/comments/345040.htmlhttp://m.tkk7.com/vcycyv/archive/2011/02/24/345040.html#Feedback0http://m.tkk7.com/vcycyv/comments/commentRss/345040.htmlhttp://m.tkk7.com/vcycyv/services/trackbacks/345040.html闃呰鍏ㄦ枃

]]>
spring security2 閰嶇疆綺捐錛堣漿錛?/title><link>http://m.tkk7.com/vcycyv/archive/2011/02/13/344196.html</link><dc:creator>浜哄湪姹熸箹</dc:creator><author>浜哄湪姹熸箹</author><pubDate>Sun, 13 Feb 2011 06:47:00 GMT</pubDate><guid>http://m.tkk7.com/vcycyv/archive/2011/02/13/344196.html</guid><wfw:comment>http://m.tkk7.com/vcycyv/comments/344196.html</wfw:comment><comments>http://m.tkk7.com/vcycyv/archive/2011/02/13/344196.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/vcycyv/comments/commentRss/344196.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/vcycyv/services/trackbacks/344196.html</trackback:ping><description><![CDATA[     鎽樿: 杞澆鑷細(xì)http://www.javaeye.com/topic/319965 璁哄潧涓婄湅浜?jiǎn)涓崬畱Spring Security鐨勭浉鍏蟲(chóng)枃绔犮傝繖浜涙枃绔犲熀鏈笂閮借繕鏄熀浜嶢cegi-1.X鐨勯厤緗柟寮忥紝鑰屼富瑕佺殑閰嶇疆紺轟緥涔熸潵鑷簬SpringSide鐨勮礎(chǔ)鐚? 浼楁墍鍛ㄧ煡錛孲pring Security閽堝Acegi鐨勪竴涓噸澶х殑鏀硅繘灝卞湪浜庡叾閰嶇疆鏂瑰紡澶уぇ綆鍖栦簡(jiǎn)銆傛墍浠ュ鏋滈厤緗繕鏄熀浜嶢cegi-1.X榪欐牱姣旇緝綣佺悙鐨?..  <a href='http://m.tkk7.com/vcycyv/archive/2011/02/13/344196.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/vcycyv/aggbug/344196.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/vcycyv/" target="_blank">浜哄湪姹熸箹</a> 2011-02-13 14:47 <a href="http://m.tkk7.com/vcycyv/archive/2011/02/13/344196.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>spring factory-method 鍔ㄦ佷紶鍙傛暟錛堣漿錛?/title><link>http://m.tkk7.com/vcycyv/archive/2011/01/30/343778.html</link><dc:creator>浜哄湪姹熸箹</dc:creator><author>浜哄湪姹熸箹</author><pubDate>Sun, 30 Jan 2011 10:04:00 GMT</pubDate><guid>http://m.tkk7.com/vcycyv/archive/2011/01/30/343778.html</guid><wfw:comment>http://m.tkk7.com/vcycyv/comments/343778.html</wfw:comment><comments>http://m.tkk7.com/vcycyv/archive/2011/01/30/343778.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/vcycyv/comments/commentRss/343778.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/vcycyv/services/trackbacks/343778.html</trackback:ping><description><![CDATA[<p>杞澆鑷?<a title="http://forum.springsource.org/showthread.php?t=50934" >http://forum.springsource.org/showthread.php?t=50934</a></p> <div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"> <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1"> 1:</span> <span style="color: #0000ff">class</span> ExampleBean {</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2"> 2:</span> <span style="color: #0000ff">private</span> String string;</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3"> 3:</span> <span style="color: #0000ff">public</span> ExampleBean(String string) {</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4"> 4:</span> <span style="color: #0000ff">this</span>.string = string;</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5"> 5:</span> }</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6"> 6:</span> </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7"> 7:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> write() {</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8"> 8:</span> System.out.println(<span style="color: #006080">"The text is: "</span> + text);</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9"> 9:</span> }</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10"> 10:</span>  </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11"> 11:</span> }</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12"> 12:</span>  </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13"> 13:</span> <span style="color: #0000ff">class</span> ExampleBeanFactory {</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14"> 14:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> ExampleBean createExampleBean(String string) {</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15"> 15:</span> <span style="color: #0000ff">return</span> <span style="color: #0000ff">new</span> ExampleBean(string);</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16"> 16:</span> }</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17"> 17:</span> }</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18"> 18:</span>  </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19"> 19:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> Main {</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20"> 20:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> main(String[] args) {</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21"> 21:</span> ApplicationContext context = <span style="color: #0000ff">new</span> ClassPathXmlApplicationContext(</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22"> 22:</span> <span style="color: #006080">"context.xml"</span>);</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23"> 23:</span> ExampleBean exampleBean = </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24"> 24:</span> ExampleBean)context.getBean(<span style="color: #006080">"exampleBean"</span>, </pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25"> 25:</span> <span style="color: #0000ff">new</span> Object[]{<span style="color: #006080">"bla bla"</span>});</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26"> 26:</span> exampleBean.write();</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27"> 27:</span> }</pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28"> 28:</span> }</pre><!--CRLF--></div></div> <div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"> <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1"> 1:</span> <span style="color: #0000ff"><</span><span style="color: #800000">bean</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">="exampleBean"</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">="...ExampleBeanFactory"</span> <span style="color: #ff0000">scope</span><span style="color: #0000ff">="prototype"</span></pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2"> 2:</span> <span style="color: #ff0000">factory-method</span><span style="color: #0000ff">="createExampleBean"</span><span style="color: #0000ff">></span></pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3"> 3:</span> <span style="color: #0000ff"><</span><span style="color: #800000">constructor-arg</span> <span style="color: #ff0000">value</span><span style="color: #0000ff">="default value"</span><span style="color: #0000ff">/></span></pre><!--CRLF--><pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4"> 4:</span> <span style="color: #0000ff"></</span><span style="color: #800000">bean</span><span style="color: #0000ff">></span></pre><!--CRLF--></div></div> <p> </p> <p>娉ㄦ剰scope浣跨敤prototype</p> <img src ="http://m.tkk7.com/vcycyv/aggbug/343778.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/vcycyv/" target="_blank">浜哄湪姹熸箹</a> 2011-01-30 18:04 <a href="http://m.tkk7.com/vcycyv/archive/2011/01/30/343778.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://51porn3.com" target="_blank">亚洲国产成人久久精品大牛影视</a>| <a href="http://66qiqi.com" target="_blank">午夜色a大片在线观看免费</a>| <a href="http://yw835.com" target="_blank">内射无码专区久久亚洲</a>| <a href="http://ikybh.com" target="_blank">亚洲国产成人手机在线观看</a>| <a href="http://www-715111.com" target="_blank">1000部拍拍拍18勿入免费视频下载 </a>| <a href="http://tzntrip.com" target="_blank">A国产一区二区免费入口</a>| <a href="http://xxxxxxxxcccc.com" target="_blank">国产免费爽爽视频在线观看 </a>| <a href="http://fuzhiwushu.com" target="_blank">美景之屋4在线未删减免费</a>| <a href="http://www759696b.com" target="_blank">嫩草影院免费观看</a>| <a href="http://28896543.com" target="_blank">亚洲午夜理论片在线观看</a>| <a href="http://qinglou31.com" target="_blank">永久免费AV无码国产网站</a>| <a href="http://shzzhsy.com" target="_blank">亚洲人成77777在线观看网</a>| <a href="http://234an.com" target="_blank">可以免费看黄的网站</a>| <a href="http://szgyk.com" target="_blank">中文字幕精品无码亚洲字 </a>| <a href="http://codecampo.com" target="_blank">一区二区三区免费电影</a>| <a href="http://97chaopeng2.com" target="_blank">1000部无遮挡拍拍拍免费视频观看</a>| <a href="http://datian-cn.com" target="_blank">亚洲VA成无码人在线观看天堂</a>| <a href="http://www-993789.com" target="_blank">caoporm碰最新免费公开视频</a>| <a href="http://livejimmy.com" target="_blank">免费吃奶摸下激烈视频</a>| <a href="http://sflhb.com" target="_blank">亚洲三级在线视频</a>| <a href="http://haodiaose35pao.com" target="_blank">香蕉免费一级视频在线观看</a>| <a href="http://ghdc5.com" target="_blank">亚洲日韩欧洲乱码AV夜夜摸</a>| <a href="http://jastrelax.com" target="_blank">亚洲人成网站免费播放</a>| <a href="http://69xjk.com" target="_blank">日本久久久免费高清</a>| <a href="http://youweidianqi.com" target="_blank">阿v视频免费在线观看</a>| <a href="http://hn-hshb.com" target="_blank">久久亚洲av无码精品浪潮</a>| <a href="http://626393.com" target="_blank">91国内免费在线视频</a>| <a href="http://kmyake.com" target="_blank">免费一级特黄特色大片在线观看</a>| <a href="http://42329c.com" target="_blank">色www免费视频</a>| <a href="http://4388x4.com" target="_blank">亚洲精品无码久久久久</a>| <a href="http://626632.com" target="_blank">日本黄页网址在线看免费不卡</a>| <a href="http://3t77.com" target="_blank">亚洲一区日韩高清中文字幕亚洲</a>| <a href="http://3c3w.com" target="_blank">中文在线观看国语高清免费</a>| <a href="http://cnpc1002.com" target="_blank">亚洲国产成人久久一区WWW</a>| <a href="http://guanxianedu.com" target="_blank">一区二区在线免费视频</a>| <a href="http://51jingpai.com" target="_blank">亚洲AV日韩精品久久久久</a>| <a href="http://syeyo.com" target="_blank">a级毛片黄免费a级毛片</a>| <a href="http://nkldj.com" target="_blank">亚洲精品自拍视频</a>| <a href="http://519vip.com" target="_blank">免费v片在线观看视频网站</a>| <a href="http://2c06xyz.com" target="_blank">日韩精品一区二区亚洲AV观看</a>| <a href="http://www-777768.com" target="_blank">无码区日韩特区永久免费系列</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>