锘??xml version="1.0" encoding="utf-8" standalone="yes"?>自拍自偷一区二区三区,国产综合色在线观看,久久人人97超碰comhttp://www.aygfsteel.com/zhaijianhui/category/11283.html鐮旂┒java鎶鏈?/description>zh-cnFri, 02 Mar 2007 14:47:38 GMTFri, 02 Mar 2007 14:47:38 GMT60spring闆嗘垚鍒皐eb妗嗘灦http://www.aygfsteel.com/zhaijianhui/archive/2006/08/02/61423.html铚樿洓铚樿洓Wed, 02 Aug 2006 15:41:00 GMThttp://www.aygfsteel.com/zhaijianhui/archive/2006/08/02/61423.htmlhttp://www.aygfsteel.com/zhaijianhui/comments/61423.htmlhttp://www.aygfsteel.com/zhaijianhui/archive/2006/08/02/61423.html#Feedback0http://www.aygfsteel.com/zhaijianhui/comments/commentRss/61423.htmlhttp://www.aygfsteel.com/zhaijianhui/services/trackbacks/61423.html鎶妔pring闆嗘垚鍒皐eb妗嗘灦寰堢畝鍗曪紝鍙鍦╳eb.xml閲岄潰鍔犱笂
<context-param>
聽聽聽 <param-name>contextConfigLocation</param-name>
聽聽聽 <param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
鎴栬?br /><listener>
聽聽聽 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
濡傛灉涓轟笅闈㈣繖縐嶆柟寮忕殑璇濓紝閭d箞灝辨槸鍔犺澆榛樿鐨勬枃浠?br />/WEB-INF/applicationContext.xml
榪欎釜鍦?br />
org.springframework.web.context.support.XmlWebApplicationContext綾婚噷闈㈠畾涔夌殑,,閮ㄥ垎浠g爜錛?br />/** Default config location for the root context */
聽public static final String DEFAULT_CONFIG_LOCATION = "/WEB-INF/applicationContext.xml";

聽/** Default prefix for building a config location for a namespace */
聽public static final String DEFAULT_CONFIG_LOCATION_PREFIX = "/WEB-INF/";

聽/** Default suffix for building a config location for a namespace */
聽public static final String DEFAULT_CONFIG_LOCATION_SUFFIX = ".xml";


Once the context files are loaded, Spring creates a WebApplicationContext object based on the bean definitions and puts it into the ServletContext.
榪欐牱鎴戜滑灝卞彲浠ョ洿鎺ョ敤ServletContext鑾峰彇鑷繁鎯寵鐨勫弬鏁扮殑錛岋紝

All Java web frameworks are built on top of the Servlet API, so you can use the following code to get the ApplicationContext that Spring created.

WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(servletContext);

閫氳繃WebApplicationContext鎴戜滑灝卞彲浠ラ氳繃bean鐨勫悕瀛楄幏鍙栧畠鐨勫疄渚嬩簡
The WebApplicationContextUtils class is for convenience, so you don't have to remember the name of the ServletContext attribute. Its getWebApplicationContext() method will return null if an object doesn't exist under the WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE key. Rather than risk getting NullPointerExceptions in your application, it's better to use the getRequiredWebApplicationContext() method. This method throws an Exception when the ApplicationContext is missing.

Once you have a reference to the WebApplicationContext, you can retrieve beans by their name or type. Most developers retrieve beans by name, then cast them to one of their implemented interfaces.

Fortunately, most of the frameworks in this section have simpler ways of looking up beans. Not only do they make it easy to get beans from the BeanFactory, but they also allow you to use dependency injection on their controllers. Each framework section has more detail on its specific integration strategies.



铚樿洓 2006-08-02 23:41 鍙戣〃璇勮
]]>
璇誨彇閰嶇疆鏂囦歡鐨勫嚑縐嶆柟娉?/title><link>http://www.aygfsteel.com/zhaijianhui/archive/2006/06/03/50104.html</link><dc:creator>铚樿洓</dc:creator><author>铚樿洓</author><pubDate>Sat, 03 Jun 2006 03:24:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhaijianhui/archive/2006/06/03/50104.html</guid><wfw:comment>http://www.aygfsteel.com/zhaijianhui/comments/50104.html</wfw:comment><comments>http://www.aygfsteel.com/zhaijianhui/archive/2006/06/03/50104.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhaijianhui/comments/commentRss/50104.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhaijianhui/services/trackbacks/50104.html</trackback:ping><description><![CDATA[鍦ㄨspring in aciton 鏃訛紝浠栫敤鐨凚eanFactory factory = new XmlBeanFactory(new FileInputStream("hello.xml"));<br />鍙槸鐜板湪鐨勭敤鐨?.2.6鐗堟湰鐨勬瀯閫犲櫒(XmlBeanFactory)鍙兘鎺ユ敹Resource鎺ュ彛浜嗭紝鎵浠ヨ皟涓嶅嚭鏉ユ槸姝e父鐨勪簨鎯咃紝鍋囪鐜板湪鏈変竴涓枃浠秇ello.xml<br />璇誨彇鏂規硶<br /><br />1:ApplicationContext cx=new FileSystemXmlApplicationContext("hello.xml");//鎸囧畾鐨勮礬寰勫幓鎵炬枃浠?br />2:ApplicationContext factory = new ClassPathXmlApplicationContext("hello.xml");//榪樹細鍦╟lasspath鍘繪壘<br />3:Resource fa = new FileSystemResource("hello.xml");<br />聽 聽BeanFactory factory=new XmlBeanFactory(fa);<br />4:榪欎釜瑕佽鍒禼lasspath浜嗭紝楹葷儲<br />銆聽Resource res = new ClassPathResource("com/springinaction/chapter01/hello/hello.xml");<br />銆聽BeanFactory factory=new XmlBeanFactory(res);<br />濂戒簡錛岀敤浜嗕笂闈㈤偅縐嶆柟娉曢兘鍙互璋冪敤getBean("your bean name")浜嗭紝<br />eg:聽BeanFactory factory=new XmlBeanFactory(fa);<br />聽聽聽聽聽 hello he=(hello)factory.getBean("hello");<br />聽聽聽聽聽聽聽聽聽聽聽聽聽 he.getHello();<img src ="http://www.aygfsteel.com/zhaijianhui/aggbug/50104.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhaijianhui/" target="_blank">铚樿洓</a> 2006-06-03 11:24 <a href="http://www.aygfsteel.com/zhaijianhui/archive/2006/06/03/50104.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>spring鍏ラ棬涓庡疄璺?/title><link>http://www.aygfsteel.com/zhaijianhui/archive/2006/06/01/49380.html</link><dc:creator>铚樿洓</dc:creator><author>铚樿洓</author><pubDate>Wed, 31 May 2006 17:37:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhaijianhui/archive/2006/06/01/49380.html</guid><wfw:comment>http://www.aygfsteel.com/zhaijianhui/comments/49380.html</wfw:comment><comments>http://www.aygfsteel.com/zhaijianhui/archive/2006/06/01/49380.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhaijianhui/comments/commentRss/49380.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhaijianhui/services/trackbacks/49380.html</trackback:ping><description><![CDATA[涓轟粬鏂逛究澶у鏇村揩鐨勫涔燬pring錛岀壒鏁寸悊浜嗙涓涓疄渚嬶紝<br />鍋氭垚浜唒df鏍煎紡,榪橀檮甯︽簮浠g爜錛屾榪庝笅杞?br />寮鍙戝鉤鍙?br />myeclipse 4.1.1GA<br />eclipse 3.1.2<br />浣犱篃鍙互閫夋嫨鍏跺畠寮鍙戝伐鍏?騫朵笉褰卞搷浣犻槄璇繪鏁欑▼.<a href="/Files/zhaijianhui/spring"><br />http://www.aygfsteel.com/Files/zhaijianhui/spring</a>鍏ラ棬.rar<img src ="http://www.aygfsteel.com/zhaijianhui/aggbug/49380.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhaijianhui/" target="_blank">铚樿洓</a> 2006-06-01 01:37 <a href="http://www.aygfsteel.com/zhaijianhui/archive/2006/06/01/49380.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> 主站蜘蛛池模板: <a href="http://" target="_blank">谢通门县</a>| <a href="http://" target="_blank">阳原县</a>| <a href="http://" target="_blank">曲麻莱县</a>| <a href="http://" target="_blank">霍州市</a>| <a href="http://" target="_blank">米脂县</a>| <a href="http://" target="_blank">汉寿县</a>| <a href="http://" target="_blank">葵青区</a>| <a href="http://" target="_blank">新巴尔虎右旗</a>| <a href="http://" target="_blank">政和县</a>| <a href="http://" target="_blank">岑溪市</a>| <a href="http://" target="_blank">巴楚县</a>| <a href="http://" target="_blank">商都县</a>| <a href="http://" target="_blank">盘山县</a>| <a href="http://" target="_blank">沂水县</a>| <a href="http://" target="_blank">蒙山县</a>| <a href="http://" target="_blank">彭山县</a>| <a href="http://" target="_blank">涪陵区</a>| <a href="http://" target="_blank">凌云县</a>| <a href="http://" target="_blank">资兴市</a>| <a href="http://" target="_blank">安福县</a>| <a href="http://" target="_blank">调兵山市</a>| <a href="http://" target="_blank">固阳县</a>| <a href="http://" target="_blank">阜城县</a>| <a href="http://" target="_blank">宁陕县</a>| <a href="http://" target="_blank">夏邑县</a>| <a href="http://" target="_blank">江阴市</a>| <a href="http://" target="_blank">黔西</a>| <a href="http://" target="_blank">岑溪市</a>| <a href="http://" target="_blank">深泽县</a>| <a href="http://" target="_blank">时尚</a>| <a href="http://" target="_blank">监利县</a>| <a href="http://" target="_blank">清水河县</a>| <a href="http://" target="_blank">赤水市</a>| <a href="http://" target="_blank">齐齐哈尔市</a>| <a href="http://" target="_blank">芷江</a>| <a href="http://" target="_blank">敦化市</a>| <a href="http://" target="_blank">南溪县</a>| <a href="http://" target="_blank">隆化县</a>| <a href="http://" target="_blank">读书</a>| <a href="http://" target="_blank">南陵县</a>| <a href="http://" 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>