??xml version="1.0" encoding="utf-8" standalone="yes"?>www.视频一区,欧美午夜精品一区二区三区电影,视频一区中文http://www.aygfsteel.com/Tomshi-Xu/zh-cnWed, 18 Jun 2025 14:05:07 GMTWed, 18 Jun 2025 14:05:07 GMT60sql 语法 stuffhttp://www.aygfsteel.com/Tomshi-Xu/archive/2013/02/24/395642.htmlTom XuTom XuSun, 24 Feb 2013 03:21:00 GMThttp://www.aygfsteel.com/Tomshi-Xu/archive/2013/02/24/395642.htmlhttp://www.aygfsteel.com/Tomshi-Xu/comments/395642.htmlhttp://www.aygfsteel.com/Tomshi-Xu/archive/2013/02/24/395642.html#Feedback0http://www.aygfsteel.com/Tomshi-Xu/comments/commentRss/395642.htmlhttp://www.aygfsteel.com/Tomshi-Xu/services/trackbacks/395642.html1、作?br />删除指定长度的字W,q在指定的v点处插入另一l字W?/p>

2、语?br />STUFF ( character_expression , start , length ,character_expression )

3、示?br />以下CZ在第一个字W串 abcdef 中删除从W?2 个位|(字符 bQ开始的三个字符Q然后在删除的v始位|插入第二个字符Ԍ从而创建ƈq回一个字W串SELECT STUFF('abcdef', 2, 3, 'ijklmn')
GO

下面是结果集
aijklmnef

4、参?br />character_expression
一个字W数据表辑ּ。character_expression 可以是常量、变量,也可以是字符列或二进制数据列?/p>

start
一个整数|指定删除和插入的开始位|。如?start ?length Q则q回I字W串。如?start 比第一?character_expression长,则返回空字符丌Ӏstart 可以?bigint cd?/p>

length
一个整敎ͼ指定要删除的字符数。如?length 比第一?character_expression长,则最多删除到最后一?character_expression 中的最后一个字W。length 可以?bigint cd?/p>

5、返回类?br />如果 character_expression 是受支持的字W数据类型,则返回字W数据。如?character_expression 是一个受支持?binary 数据cdQ则q回二进制数据?/p>

6、备?br />如果l果值大于返回类型支持的最大|则生错误?br />Q资料来源于|络Q?br />



Tom Xu 2013-02-24 11:21 发表评论
]]>
Spring 学习W记Q实例化方式 spring bean作用?spring依赖注入 spring自动扫描 spring和struts整合步骤Q?/title><link>http://www.aygfsteel.com/Tomshi-Xu/archive/2012/11/04/390767.html</link><dc:creator>Tom Xu</dc:creator><author>Tom Xu</author><pubDate>Sun, 04 Nov 2012 14:43:00 GMT</pubDate><guid>http://www.aygfsteel.com/Tomshi-Xu/archive/2012/11/04/390767.html</guid><wfw:comment>http://www.aygfsteel.com/Tomshi-Xu/comments/390767.html</wfw:comment><comments>http://www.aygfsteel.com/Tomshi-Xu/archive/2012/11/04/390767.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Tomshi-Xu/comments/commentRss/390767.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Tomshi-Xu/services/trackbacks/390767.html</trackback:ping><description><![CDATA[<div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong><font size="4"></font></strong> </div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong><font size="3">spring bean 实例化的方式</font></strong></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong>        </strong><span style="font-size: 14px">1.默认情况下是调用bean对象的默认构造函数来CZ话bean</span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">        2.调用工厂的静态方法来实例化bean</span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                <bean id="bean实例name" class="工厂c? factory-method="工厂的静态方?></bean></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">        3.调用工厂Ҏ来实例化bean</span></div><span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">                 <bean id="工厂实例name" class="工厂c?  class="工厂cd"></span><br style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                 <bean id="bean实例name" factory-name="工厂实例name",factory-method="工厂的非静态方?></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><font size="3"><strong>spring bean 的作用域 (可以使用scope="singleton/prototype/request/session/global session"来配|?</strong></font></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">        1.默认作用域(singletonQ情况下Q?/span></div> <blockquote style="border-bottom-style: none; padding-bottom: 0px; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px 微Y雅黑; white-space: normal; orphans: 2; border-top-style: none; color: rgb(0,0,0); border-right-style: none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-image: initial"> <div><span style="font-size: 14px">        bean的实例化是在容器实例化(被主动申请加载)时就实例?/span></div> <div><span style="font-size: 14px">        lazy-init="true" (延迟初始? 不会再容器实例化实例化bean (不徏议?</span></div> <div><span style="font-size: 14px">        用init-method="methodName" 可以指定bean被实例化时调用的Ҏ</span></div> <div><span style="font-size: 14px">        用destory-method="methodName" 可以制定容器调用closeҎ后bean执行的方?/span></div></blockquote><span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">         2.配置prototypeQ原型)作用域:</span><br style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /> <blockquote style="border-bottom-style: none; padding-bottom: 0px; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px 微Y雅黑; white-space: normal; orphans: 2; border-top-style: none; color: rgb(0,0,0); border-right-style: none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-image: initial"> <div><span style="font-size: 14px">       bean的实例化是在调用getBeanҎ时被实例化的</span></div> <div><span style="font-size: 14px">       每次调用一个getBeanҎ都回q回一个新的对?/span></div> <div><span style="font-size: 14px"><br /></span></div></blockquote> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><font size="3"><strong>Spring Dependency Injection(Spring的依赖注?</strong></font></div><span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">       1</span><strong style="line-height: normal; widows: 2; text-transform: none; font-variant: normal; font-style: normal; text-indent: 0px; letter-spacing: normal; font-family: 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); font-size: 14px; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">.</strong><span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">使用映射的方式注?/span><br style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /> <blockquote style="border-bottom-style: none; padding-bottom: 0px; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px 微Y雅黑; white-space: normal; orphans: 2; border-top-style: none; color: rgb(0,0,0); border-right-style: none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-image: initial"> <blockquote style="border-bottom-style: none; padding-bottom: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; padding-right: 0px; border-top-style: none; border-right-style: none; padding-top: 0px; border-image: initial"> <div><span style="font-size: 14px"><bean id="personDao" class="接口实现c\?></bean>  <span id="wmqeeuq" class="Apple-converted-space"> </span></span></div></blockquote> <blockquote style="border-bottom-style: none; padding-bottom: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; padding-right: 0px; border-top-style: none; border-right-style: none; padding-top: 0px; border-image: initial"> <div><span style="font-size: 14px"><bean id="persionService" class="接口实现的类路径"></span></div></blockquote> <blockquote style="border-bottom-style: none; padding-bottom: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; padding-right: 0px; border-top-style: none; border-right-style: none; padding-top: 0px; border-image: initial"> <div><span style="font-size: 14px">    <property name="personDao" ref="personDao"></property>   <!--反射赋?->    </span></div></blockquote> <blockquote style="border-bottom-style: none; padding-bottom: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; padding-right: 0px; border-top-style: none; border-right-style: none; padding-top: 0px; border-image: initial"> <div><span style="font-size: 14px">    <property name="name"  value="tom test!!!!!!!!"></property> <!--为基本类型赋?-></span></div></blockquote><span style="font-size: 14px">            <property name="name"  value="100"></property> <!--为基本类型赋?-></span> <blockquote style="border-bottom-style: none; padding-bottom: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; padding-right: 0px; border-top-style: none; border-right-style: none; padding-top: 0px; border-image: initial"> <div><span style="font-size: 14px"></bean></span></div></blockquote></blockquote><span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">       2.</span><span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">使用内部bean 的方式注?/span><br style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px" /> <blockquote style="border-bottom-style: none; padding-bottom: 0px; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px 微Y雅黑; white-space: normal; orphans: 2; border-top-style: none; color: rgb(0,0,0); border-right-style: none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-image: initial"> <div><span style="font-size: 14px">        <bean id="persionService" class="实现的类路径"><br /></span></div> <div><span style="font-size: 14px">             <property name="persionDao"></span></div> <div><span style="font-size: 14px">                    <bean  class="dao实现路径"/></span></div> <div><span style="font-size: 14px">             </property></span></div> <div><span style="font-size: 14px">        </bean></span></div></blockquote><span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">      3.</span><span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">集合cd的注?/span> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                  <bean id="personService" class="实现c\?></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                     <property name="sets"></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                        <set>                                                                    <!--此处可以为list--></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                                <value>一个value</value><br /></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                                <value>两个value</value></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                        </set></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                         <map></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                                 <entry key="key-1" value="value-1"/></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                                <entry key="</span><span style="font-size: 14px">key-2</span><span style="font-size: 14px">" value="value-2"/></span></div> <blockquote style="border-bottom-style: none; padding-bottom: 0px; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px 微Y雅黑; white-space: normal; orphans: 2; border-top-style: none; color: rgb(0,0,0); border-right-style: none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-image: initial"> <blockquote style="border-bottom-style: none; padding-bottom: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; padding-right: 0px; border-top-style: none; border-right-style: none; padding-top: 0px; border-image: initial"> <blockquote style="border-bottom-style: none; padding-bottom: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; padding-right: 0px; border-top-style: none; border-right-style: none; padding-top: 0px; border-image: initial"> <div><span style="font-size: 14px">  <entry key="</span><span style="font-size: 14px">key-3</span><span style="font-size: 14px">" value="value-3"/></span></div></blockquote></blockquote></blockquote> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                         </map></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                     </property></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                   </bean> </span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">      4.使用构造器参数注入Q调用特定的构造函敎ͼ</span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">             如果PersonServiceBean中的有构造函数PersonServiceBean(PersonDao personDao,String name){}</span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                <bean id="personDao11111111" class="cd现\?><bean></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                <bean id="personService" class="cd现\?></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                    <constructor-arg index="0" type="自定义typecȝ路径" ref="personDao111111"><br /></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                    <constructor-arg index="1" type="基本cd可以省去......"  value="111111111"></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">                </bean>       </span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">      5.使用Field注入Q用于注解的方式Q?/span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">        属性的值注?/span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">        @Resource private PersonDao personDao;     /* 先找?容器中的 bean的对应名U进行匹配,若无Q找cd匚w */   </span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">         属性的setҎ注入</span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">        @Resource</span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px">        public void setXXX(Object object){}     </span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: 14px"><br /></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><strong><font size="3">Spring 自动扫描和管理(扫描的方式去自动理l徏Q?/font></strong></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">引入c配|?lt;context:component-scan base-package></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">                 @Service @ Resposity</div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">          通过class cd首字母小?@Service("对象?Q来获得,也可? @scope("prototype") 来设|初始化cȝ属?/div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: medium"><span style="font-size: 14px">         可以在方法名上面@PostConstruct 可以制定初始化方?/span></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: medium"><span style="font-size: 14px">         可以在方法名上面@PreDestory 可以在bean实例被摧毁之前执行的Ҏ?br /></span></span><span style="font-size: medium"><span style="font-size: 14px"><strong><br /></strong></span></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: medium"><span style="font-size: 14px"><strong>Spring和Struts2的整?/strong></span></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: medium"><span style="font-size: 14px"><strong>1.扑ֈStruts2-Spring-plugin-.XX.jar包和Spring.jar?加入到web目的lib包下</strong></span></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: medium"><span style="font-size: 14px"><strong>2.配置WEB-INF/web.xml文g,加入与struts整合的监听器</strong></span></span></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="font-size: medium"><span style="font-size: 14px">    </span></span> <!-- </div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> <span id="wmqeeuq" class="Apple-converted-space"> </span><span style="white-space: pre" class="Apple-tab-span"> </span><context-param></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">          <param-name>contextConfigLocation</param-name></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">          <param-value>classpath:beans.xml</param-value></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="white-space: pre" class="Apple-tab-span"></span></context-param></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">     --></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">    <!-- 若applicationContext.xml文g不在WEB-INF 下则需要将\径放入上面参C--></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="white-space: pre" class="Apple-tab-span"></span><listener></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">           <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"><span style="white-space: pre" class="Apple-tab-span"></span></listener></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">        <br /></div> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px"> <div><strong>3.在struts.xml文g中加入spring帔R(structs中对象的创徏叫给spring)</strong></div> <div>     <constant name="struts.objectFactory" value="spring"/>    </div> <div> <div>    <action class="loginAction" name="loginAction_*"  method="{1}"></div> <div>         <span style="white-space: pre" class="Apple-tab-span"> </span><result name="success" type="redirect">index.jsp</result> </div> <div>   </action></div> <div><br /></div></div> <div><strong>4.创徏applicationContext.xml文gQ文件可以放在web-inf目录下,q样可以不用?中加入context的配|?/strong></div></div> <blockquote style="border-bottom-style: none; padding-bottom: 0px; widows: 2; text-transform: none; text-indent: 0px; margin: 0px 0px 0px 40px; border-left-style: none; padding-left: 0px; letter-spacing: normal; padding-right: 0px; font: 14px 微Y雅黑; white-space: normal; orphans: 2; border-top-style: none; color: rgb(0,0,0); border-right-style: none; word-spacing: 0px; padding-top: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; border-image: initial"> <div> <div><?xml version="1.0" encoding="UTF-8"?></div></div> <div> <div><beans xmlns="http://www.springframework.org/schema/beans"</div></div> <div> <div>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"</div></div> <div> <div>       xsi:schemaLocation="http://www.springframework.org/schema/beans</div></div> <div> <div>           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">           </div></div> <div> <div>    <bean id="loginAction" class="xxxxxxxxxxxxxxxxxxxxxxx" scope="prototype"/></div></div> <div> <div></beans></div></div></blockquote><span style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; display: inline !important; font: 14px 微Y雅黑; white-space: normal; orphans: 2; float: none; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">注意Q?1)struts2中需要加入prototypeQ原型)的配|,q样才能满struts2为每ơ请求创Z个对象的服务方式  </span> <div style="widows: 2; text-transform: none; text-indent: 0px; letter-spacing: normal; font: 14px 微Y雅黑; white-space: normal; orphans: 2; color: rgb(0,0,0); word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px">          (2)此处的id 名需要与3中的class同名</div><img src ="http://www.aygfsteel.com/Tomshi-Xu/aggbug/390767.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Tomshi-Xu/" target="_blank">Tom Xu</a> 2012-11-04 22:43 <a href="http://www.aygfsteel.com/Tomshi-Xu/archive/2012/11/04/390767.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>可重复性读写锁 昑ּ?隐式?U程q程同步d同步QReentrantReadWriteLock Lock Synchronized )http://www.aygfsteel.com/Tomshi-Xu/archive/2012/11/04/390766.htmlTom XuTom XuSun, 04 Nov 2012 14:37:00 GMThttp://www.aygfsteel.com/Tomshi-Xu/archive/2012/11/04/390766.htmlhttp://www.aygfsteel.com/Tomshi-Xu/comments/390766.htmlhttp://www.aygfsteel.com/Tomshi-Xu/archive/2012/11/04/390766.html#Feedback0http://www.aygfsteel.com/Tomshi-Xu/comments/commentRss/390766.htmlhttp://www.aygfsteel.com/Tomshi-Xu/services/trackbacks/390766.htmlReentrantReadWriteLock的特?/strong>

1.公^性和非公qx获取锁Q?/p>

    支持按照公^的原则获取锁Q即dU程按照最长等待时间分配锁

    若构造ؓ非公qx的Q则按照先到先得的顺序,但是有读U程惌取锁Ӟ该顺序被打破

2.重复获得锁:ȝE可以重复的获取锁,管当前ȝE占?/p>

3.锁降U:

    可以write lock 的等U降?read lock ,序是:先获得WriteLock再获得ReadLockQ然后释放WriteLockQ这时候线E将保持Readlock的持 有?/p>

   反过来ReadLock惌升为WriteLock则不可能

4.中断锁的获取Q读锁和写锁的获取期间都允许被中?/p>

5.Condition cȝ支持Q该支持仅仅写操作而言Q若readLock(0.newCondition() 会throws UnsupprotedoperationException

6.可监性:q个cL持操作是否对锁的获取q是竞争Q只是ؓ系l状态,而不是ؓ了同步而设计的?/p>


昑ּ锁(LockQ和隐式?Synchronized)的不同点Q括h明隐式锁与重复读写锁QReentrantReadWriteLockQ的区别

1.不能d中断正在试图获得锁的U程  Q显式写操作锁可以主动的挂vL作锁Q进行写操作Q?/p>

2.试图获得锁时不能讄时

3.在对象内部锁只有一个ƈ且内部锁只有一个单一的条Ӟ可能不够?昄锁可以有多个Q不断重复的对读写操作加?


对ReentrantReadWriteLockcL?/strong>

   1.?写操作的锁多U程试 : 单独的读操作和写操作何以完成L写的同步

   2.L作所和写操作锁多U程试 :  能同?(必需操作cM?ReentrantReadWriteLock声明为static的成员变?

   3.L作进E和写操作进E间试Q不支持q程间的同步



Tom Xu 2012-11-04 22:37 发表评论
]]>
U程和进E?Ҏ仉的操?RandomAccessFile MappedByteBuffer FileLock)http://www.aygfsteel.com/Tomshi-Xu/archive/2012/10/26/390291.htmlTom XuTom XuFri, 26 Oct 2012 10:34:00 GMThttp://www.aygfsteel.com/Tomshi-Xu/archive/2012/10/26/390291.htmlhttp://www.aygfsteel.com/Tomshi-Xu/comments/390291.htmlhttp://www.aygfsteel.com/Tomshi-Xu/archive/2012/10/26/390291.html#Feedback1http://www.aygfsteel.com/Tomshi-Xu/comments/commentRss/390291.htmlhttp://www.aygfsteel.com/Tomshi-Xu/services/trackbacks/390291.html阅读全文

Tom Xu 2012-10-26 18:34 发表评论
]]>
վ֩ģ壺 ͷ| ɽ| ɽ| ̳| | ޵| | ܿ| | Т| | | | | | ѭ| | տ| Ρɽ| ̨| | | | | ԣ| ³| | | | ϳ| ǹ| ƽ| º| ɽ| ư| ͭ| ɽ| | ʡ| Ȩ| |