<div class="rich_media_content">
<img alt="0?wx_fmt=png" src="https://beijingoptbbs.oss-cn-beijing.aliyuncs.com/cs/5606289-854d9fc5285e698853d304df098eae5c" style="vertical-align:middle;">
<p><span style="background-color:rgb(35,35,35);"><strong>本文作者</strong></span></p>
<img alt="0?wx_fmt=png" src="https://beijingoptbbs.oss-cn-beijing.aliyuncs.com/cs/5606289-5b39e163539920cf665cc370da9d8621" style="vertical-align:middle;">
<p><span style="font-size:18px;"><strong>20</strong></span></p>
<p><span style="font-size:13px;">1-2018</span></p>
<p><strong>zho007</strong></p>
<p style="text-align:justify;white-space:normal;"><strong>博客:</strong></p>
<p style="text-align:justify;white-space:normal;">https://www.jianshu.com/u/e9cb5fd3aaa8</p>
<p style="text-align:justify;white-space:normal;"><strong>声明:</strong>本文由作者 <span style="color:rgb(249,110,87);font-size:14px;"><strong>zho007</strong></span><strong> </strong>授权发布,未经原作者允许请勿转载</p>
<p> 看到上面<span style="font-size:14px;"><strong><span style="color:rgb(95,156,239);">蓝色字</span></strong></span>了吗,点下吧</p>
<p>系列文章:</p>
<p><br></p>
<ol class="list-paddingleft-2"><li><p><span style="letter-spacing:0px;">Spring框架-1(基础)</span><br></p></li><li><p><strong><span style="color:rgb(249,110,87);">Spring框架-2(IOC上)</span></strong></p></li><li><p>Spring框架-3(IOC下)</p></li><li><p>Spring框架-4(AOP)</p></li><li><p>Spring框架-5(JDBC模板&Spring事务管理)</p></li><li><p>Spring框架-6(SpringMvc)</p></li><li><p>Spring框架-7(搭建SSM)</p></li><li><p>Spring框架-8(SpringMVC2)</p></li></ol>
<p><br></p>
<p>日更一篇~</p>
<img alt="0?wx_fmt=png" src="https://beijingoptbbs.oss-cn-beijing.aliyuncs.com/cs/5606289-231be8cdfd52a202ac7dad609962070e" style="vertical-align:middle;">
<h3 style="line-height:inherit;margin-top:1.5em;font-weight:bold;font-size:1.3em;margin-bottom:2em;margin-right:5px;padding:8px 15px;letter-spacing:2px;background-color:rgb(63,81,181);color:rgb(255,255,255);border-left:10px solid rgb(51,51,51);"><span style="font-size:inherit;color:inherit;line-height:inherit;">前言</span></h3>
<blockquote style="line-height:inherit;padding:15px 15px 15px;font-size:.9em;margin-top:1em;margin-bottom:1em;color:rgb(129,145,152);border-left-width:6px;border-left-color:rgb(220,230,240);background:rgb(242,247,251);">
<p style="font-size:inherit;color:inherit;line-height:inherit;">在上一篇文章我们已经梳理了一下spring框架的基础知识内容。接下来我们来分析和实践一下IOC吧!研究研究IOC的原理,看看IOC怎么使用。</p>
</blockquote>
<p style="font-size:inherit;color:inherit;line-height:inherit;margin-top:1.5em;margin-bottom:1.5em;">首先看下我们需要学习一些什么吧!如下图:</p>
<p style="font-size:inherit;color:inherit;line-height:inherit;margin-top:1.5em;margin-bottom:1.5em;"><img alt="0?wx_fmt=png" src="https://beijingoptbbs.oss-cn-beijing.aliyuncs.com/cs/5606289-96feebf10492fbaf504ab752aadc0344" style="font-size:inherit;color:inherit;line-height:inherit;margin-right:auto;margin-left:auto;"></p>
<h3 style="line-height:inherit;margin-top:1.5em;font-weight:bold;font-size:1.3em;margin-bottom:2em;margin-right:5px;padding:8px 15px;letter-spacing:2px;background-color:rgb(63,81,181);color:rgb(255,255,255);border-left:10px solid rgb(51,51,51);"><span style="font-size:inherit;color:inherit;line-height:inherit;">为什么叫控制反转?</span></h3>
<h4 style="color:inherit;line-height:inherit;margin-top:1.5em;margin-bottom:1.5em;font-weight:bold;font-size:1.2em;"><span style="font-size:inherit;color:inherit;line-height:inherit;">传统控制</span></h4>
<blockquote style="line-height:inherit;padding:15px 15px 15px;font-size:.9em;margin-top:1em;margin-bottom:1em;color:rgb(129,145,152);border-left-width:6px;border-left-color:rgb(220,230,240);background:rgb(242,247,251);">
<p style="font-size:inherit;color:inherit;line-height:inherit;">假设我需要两个资源,那么我们是怎么做的呢?ZiYuan ziYuan =new ZiYuan();然后我拿到了资源对象。</p>
</blockquote>
<p style="font-size:inherit;color:inherit;line-height:inherit;margin-top:1.5em;margin-bottom:1.5em;"><img alt="0?wx_fmt=png" src="https://beijingoptbbs.oss-cn-beijing.aliyuncs.com/cs/5606289-313b14bea185014d08ef113c806d7f3c" style="font-size:inherit;color:inherit;line-height:inherit;margin-right:auto;margin-left:auto;"></p>
<h4 style="color:inherit;line-height:inherit;margin-top:1.5em;margin-bottom:1.5em;font-weight:bold;font-size:1.2em;"><span style="font-size:inherit;color:inherit;line-height:inherit;">Spring控制反转</span></h4>
<blockquote style="line-height:inherit;padding:15px 15px 15px;font-size:.9em;margin-top:1em;margin-bottom:1em;color:rgb(129,145,152);border-left-width:6px;border-left-color:rgb(220,230,240);background:rgb(242,247,251);">
<p style="font-size:inherit;color:inherit;line-height:inherit;">那么在Spring当中我需要资源是怎么玩的呢?</p>
</blockquote>
<ul class="list-paddingleft-2"><li><p><span style="font-size:inherit;color:inherit;line-height:inherit;">在我们项目中是给这个类写一个注解,例如@controller,@Component等。然后编写一个Spring的配置文件,Spring就会直接扫描指定的包名创建指定的对象 |
|