<?xml version="1.0" encoding="utf-8" ?>
<!-- generator="FEEDCREATOR_VERSION" -->
<rss version="2.0" xmlns:sns="http://blog.sina.com.cn/sns">
    <channel>
        <title>付老实的BLOG</title>
        <description></description>
        <link>http://blog.sina.com.cn/fulaoshi</link>
        <lastBuildDate>Wed, 06 Jan 2010 10:08:57 GMT+8</lastBuildDate>
        <generator>FEEDCREATOR_VERSION</generator>
        <language>zh-cn</language>
        <copyright>Copyright 1996 - 2009 SINA Inc. All Rights Reserved.</copyright>
        <pubDate>Wed, 06 Jan 2010 02:08:57 GMT+8</pubDate>
        <item>
            <title>策略模式</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100eylm.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;&nbsp;
策略模式用于封装不同的算法（实现细节），使用者通过同一接口可以选择不同的实现算法。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
现实中有很多策略模式应用的例子，比如玩电脑游戏时，根据电脑显卡的配置可以选择图像显示使用“硬件加速”或者“软件加速”，不同的选择不会改变游戏的内容，但是会影响图像显示的方法和显示效果。</P>
<p>&nbsp;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;再比如我国传统中医医学中，使用中草药为患者治病，无论患者得的是什么病，开的药方都由君、臣、佐、使组成，其中“君药”起到主治作用，“臣药”增强君药的作用，“佐药”增强疗效或降低毒副作用，“使药”作为调和或药引。如果患者经过辩证后认为是伤寒，则以麻黄为君药发汗，桂枝为臣药辅助发汗，杏仁为佐药平喘，甘草为使药调和君、臣、使三者的药性；如果认为患者是风湿，则以防已为君药祛风行水，黄芪为臣药辅助行水、消肿，白术为佐药健脾、止汗，甘草、生姜、大枣为使药调和各药的药性。下面是两个情景的示意类图：</P>
<p>&nbsp;</P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static2.photo.sina.com.cn/orignal/4a5ca024x734786192531&amp;690" TARGET="_blank"><img STYLE="MAx-WiDTH: 500px" SRC="http://static2.photo.sina.com.cn/bmiddle/4a5ca024x734786192531&amp;690" /></A></P>
<p>&nbsp;</P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static4.photo.sina.com.cn/orignal/4a5ca024x73478833c6b3&amp;690" TARGET="_blank"><img STYLE="MAx-WiDTH: 500px" SRC="http://static4.photo.sina.com.cn/bmiddle/4a5ca024x73478833c6b3&amp;690" /></A></P>
<p>&nbsp;</P>
<p ALIGN="left">
&nbsp;&nbsp;&nbsp;
策略模式中需要定义一个抽象策略角色，规定策略中的方法定义；具体的策略角色继承自抽象策略角色，实现具体的方法。使用者可以选择不同的策略角色实现相应的功能。</P>
<p ALIGN="left">&nbsp;</P>]]></description>
            <author>付老实</author>
            <category>架构技术</category>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100eylm.html#comment</comments>
            <pubDate>Fri, 11 Sep 2009 06:33:53 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100eylm.html</guid>
        </item>
        <item>
            <title>潜心开发软件，暂停blog</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100cz1x.html</link>
            <description><![CDATA[<p>潜心开发软件，暂停blog。</P>
<p>&nbsp;</P>
<p>开发成功后和大家分享体会哦，呵呵。</P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100cz1x.html#comment</comments>
            <pubDate>Thu, 23 Apr 2009 13:52:38 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100cz1x.html</guid>
        </item>
        <item>
            <title>疙瘩</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100csb6.html</link>
            <description><![CDATA[<p ALIGN="center"><font STYLE="FONT-SIZE: 56px" COLOR="#CC0000">谁有创可贴？</FONT></P>
<p ALIGN="center">&nbsp;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;
贾樟柯的电影《世界》中，女主角一开始就这么大呼小叫，很现实又很超现实的台词和电影。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
这两天又开始一年一度的过敏症，身上长疙瘩，奇痒，怕抓破，也开始到处寻找创可贴。</P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100csb6.html#comment</comments>
            <pubDate>Sun, 12 Apr 2009 02:00:05 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100csb6.html</guid>
        </item>
        <item>
            <title>很强的JQuery</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100cpij.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;&nbsp;
一直为项目采用何种RIA实现方式困扰，否定了flex，ext之后，终于选定了JQuery。理由么，JQuery并没有大量的封装javascript，迫使使用者需要系统的学习JQuery
API，而是通过对DOM对象增强+API的方式工作。这样传统的javascript代码和HTML标签可以很好的与JQuery并存，并不用大面积的修改。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
在JQuery的基础上进行开发也很方便，比传统javascript可以节省不少代码量。只不过捏，以前过于习惯于IE标准，这回要完全按照DOM标准写Javascript，很多原来习惯的用法不能用了，有点郁闷，呵呵。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
这两天写了不少控件，贴出使用说明来秀秀。</P>
<p>&nbsp;</P>
<p><strong>统计函数</STRONG><br />
统计函数可以用来统计指定HTML元素中值（值指经过转换后的innerText属性）的总和，比如对表格中行或列的统计。<br />
语法：<br />
$(选择器).sum([转换回调函数])<br />
示例：<br />
1：当元素中的值为数字时的使用方法，下例统计了表格中第2列的总和<br />
$('table tbody tr td:nth-child(2)').sum()<br />
2：当元素中的值为其他类型时的使用方法，下例统计了表格中第3列中内容为“男”的总和<br />
$('table tbody tr td:nth-child(4)').sum(function(n){if (n=='男')
return 1; else return 0;})<br />
注意：<br />
转换回调函数参数为统计元素的内容，返回值必须为数值类型。<br />
已知Bug：<br />
无</P>
<p><br />
<strong>表格控件</STRONG><br />
表格控件用来增强HTML表格功能，目前支持隔行换色，鼠标悬停，排序，调整表格大小等功能。<br />
语法：<br />
makeTable(DIV的id属性);<br />
示例：<br />
makeTable("div")<br />
HTML标签：<br />
&lt;div id="div" style="width:500px;padding:0px"
resizable="true" stripe="true" hover="true"&gt;<br />
&nbsp;&nbsp; &lt;table
width="100%"&gt;<br />
&nbsp;&nbsp;
&nbsp;&lt;thead&gt;<br />
&nbsp;&nbsp;
&nbsp;&nbsp;&lt;tr&gt;<br />

&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&lt;th
sort="true"&gt;姓名&lt;/th&gt;<br />

&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&lt;th
sort="number"&gt;年龄&lt;/th&gt;<br />

&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&lt;th
sort="date"&gt;生日&lt;/th&gt;<br />

&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&lt;th
sort="true"&gt;性别&lt;/th&gt;<br />

&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&lt;th
&gt;操作&lt;/th&gt;<br />
&nbsp;&nbsp;
&nbsp;&nbsp;&lt;/tr&gt;<br />

&nbsp;&nbsp;
&nbsp;&lt;/thead&gt;<br />
&nbsp;&nbsp;
&nbsp;&lt;tbody&gt;<br />
&nbsp;&nbsp;
&nbsp;&nbsp;……&nbsp;……&nbsp;表格数据部分&nbsp;……&nbsp;……<br />

&nbsp;&nbsp;
&nbsp;&lt;/tbody&gt;<br />
&lt;/table&gt;<br />
&lt;/div&gt;<br />
注意：<br />
必须将&lt;TABLE&gt;放在&lt;DIV&gt;中进行使用。&lt;TABLE&gt;中如果存在标题行必须使用&lt;THEAD&gt;和&lt;TH&gt;标签<br />

表格控件通过扩展HTML元素的属性来进行设置，说明如下<br />
DIV元素中的属性：<br />
resizable&nbsp;&nbsp;：&nbsp;是否支持调整大小，默认不支持<br />

stripe&nbsp;&nbsp;：&nbsp;是否支持隔行换色，默认不支持<br />

hover&nbsp;&nbsp;：&nbsp;是否支持鼠标悬停，默认不支持<br />

TH元素中的属性：<br />
sort&nbsp;&nbsp;&nbsp;：&nbsp;是否进行排序，值可为true（字符串格式排序），number（数字格式排序），date（日期格式排序），默认不排序<br />

已知Bug：<br />
如果启动了隔行换色，则当手工调整单元行（&lt;TR&gt;）的顺序，或删除、添加单元行时，不会重新进行渲染，需要再次调用一遍makeTable方法。此时不会记忆原排序的参数（当前排序列，正序还是倒序）<br />

表格排序后，如果单元格内容发生改变，无法自动进行排序，需要重新点击可排序的标题行。<br />
排序功能目前仅支持IE浏览器，其他功能可以跨浏览器运行。<br />
调整大小Handle图标有时显示位置不正常，但不影响正常使用。<br />
在不同浏览器中，调整大小功能的表现会有一些差别。</P>
<p><br />
<strong>验证控件</STRONG><br />
验证控件用来对FORM表单的元素进行验证，并提示验证结果。</P>]]></description>
            <author>付老实</author>
            <category>表现层技术</category>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100cpij.html#comment</comments>
            <pubDate>Sun, 05 Apr 2009 09:19:03 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100cpij.html</guid>
        </item>
        <item>
            <title>好牛的外交部问答……</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100cnsj.html</link>
            <description><![CDATA[<strong>问：上周Youtube网站曾一度被屏蔽，现在又再次被封，有人猜测是这跟“西藏流亡政府”发布在Youtube上的一段视频有关。你对此有何评论？还是Youtube上又出现了一些导致它被封的视频片断？</STRONG>
<p>
　　答：上次记者会我已经回答了这个问题，我在这里再简短重申一下。中国的互联网是充分开放的，同时中国政府也要依法管理网络。至于能看什么，不能看什么，能看的就看，不能看的就别看。</P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100cnsj.html#comment</comments>
            <pubDate>Wed, 01 Apr 2009 00:23:19 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100cnsj.html</guid>
        </item>
        <item>
            <title>2009年的采购计划</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100cinj.html</link>
            <description><![CDATA[<p>2008年过去了，很多想买的东西都没有买 <img SRC="http://simg.sinajs.cn/blog/images/face/014.gif" />&nbsp;</P>
<p>iPhone ： 一直没有行货，不过Kay买了一个，没事儿用用他的也可以过瘾</P>
<p>iMac or Macbook ： 没买的主要价格因素还是价格因素，不过去年也用旺旺的机器把玩了一段时间</P>
<p>iRobot ： 一个是价格因素，一个是从美国运回来不方便，放弃</P>
<p>洗碗机 ： 政治因素（内政）</P>
<p>&nbsp;</P>
<p>不过买了wii，还是很高兴，每天回家玩，哈哈。各位有wii的朋友放出马里奥赛车的FC号，一起联机玩啊。</P>
<p>&nbsp;</P>
<p>现在列出今年的采购计划，到年底看看能实现多少</P>
<p>1，iMac或Mac Mini或Macbook，没有一款苹果的电脑还是觉得不甘心啊。</P>
<p>2，3G手机，可以移动上网，不再受制于双鱼校区乌龟一样的网速。</P>
<p>3，Kindle 2或Sony Reader，电子阅读器，随时随地读书。</P>
<p>4，一套音响，入门级即可</P>
<p>&nbsp;</P>
<p>呵呵，金融危机，银根得紧缩，就列这么多吧。</P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100cinj.html#comment</comments>
            <pubDate>Wed, 18 Mar 2009 06:07:49 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100cinj.html</guid>
        </item>
        <item>
            <title>进入软件工厂，你准备好了吗?</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100ci7i.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;&nbsp;
《进入软件工厂，你准备好了吗
?》，这是一套准备在各个Y2班级进行宣讲的PPT。也是看了演说之禅后写的第一个PPT，感觉比之前写的PPT有质的飞跃，嘿嘿
<img SRC="http://simg.sinajs.cn/blog/images/face/003.gif" /></P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
大家提提意见哦，无论是内容还是排版、布局、图片、配色，嘿嘿</P>
<p>&nbsp;</P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static16.photo.sina.com.cn/orignal/4a5ca024x65467d38f90f" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static16.photo.sina.com.cn/bmiddle/4a5ca024x65467d38f90f" /></A></P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static6.photo.sina.com.cn/orignal/4a5ca024x65467eb59ab5" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static6.photo.sina.com.cn/bmiddle/4a5ca024x65467eb59ab5" /></A></P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static9.photo.sina.com.cn/orignal/4a5ca024x654681921978" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static9.photo.sina.com.cn/bmiddle/4a5ca024x654681921978" /></A></P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static6.photo.sina.com.cn/orignal/4a5ca024x6546829b9d45" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static6.photo.sina.com.cn/bmiddle/4a5ca024x6546829b9d45" /></A></P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static15.photo.sina.com.cn/orignal/4a5ca024x654683e1330e" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static15.photo.sina.com.cn/bmiddle/4a5ca024x654683e1330e" /></A></P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static13.photo.sina.com.cn/orignal/4a5ca024x654684ee45bc" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static13.photo.sina.com.cn/bmiddle/4a5ca024x654684ee45bc" /></A></P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static3.photo.sina.com.cn/orignal/4a5ca024x654685e37072" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static3.photo.sina.com.cn/bmiddle/4a5ca024x654685e37072" /></A></P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static1.photo.sina.com.cn/orignal/4a5ca024x654687581930" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static1.photo.sina.com.cn/bmiddle/4a5ca024x654687581930" /></A></P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static5.photo.sina.com.cn/orignal/4a5ca024x6546884f1a74" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static5.photo.sina.com.cn/bmiddle/4a5ca024x6546884f1a74" /></A></P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static14.photo.sina.com.cn/orignal/4a5ca024x654689680f9d" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static14.photo.sina.com.cn/bmiddle/4a5ca024x654689680f9d" /></A></P>
<p>&nbsp;</P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static6.photo.sina.com.cn/orignal/4a5ca024x65468baa1415" TARGET="_blank"><img STYLE="MAX-WIDTH: 500px" SRC="http://static6.photo.sina.com.cn/bmiddle/4a5ca024x65468baa1415" /></A></P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100ci7i.html#comment</comments>
            <pubDate>Tue, 17 Mar 2009 01:27:46 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100ci7i.html</guid>
        </item>
        <item>
            <title>界面原型</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100cf6n.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;&nbsp;
目前的这个项目我想最适合的方式就是通过界面原型来与用户进行讨论，找了一个工具Balsamiq
Mockups，然后厚着脸皮给作者发了个email要注册码，人家居然真的给了，外国人就是实诚啊（更神奇的是他居然能看懂我用英文写的email）。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
放几张截图：</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp; <a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static13.photo.sina.com.cn/orignal/4a5ca024x649184e9c8dc" TARGET="_blank"><img SRC="http://static13.photo.sina.com.cn/bmiddle/4a5ca024x649184e9c8dc" /></A></P>
<p ALIGN="center">首页</P>
<p><a href="http://blog.photo.sina.com.cn/showpic.html#url=http://static16.photo.sina.com.cn/orignal/4a5ca024x6491863129df" TARGET="_blank"><img SRC="http://static16.photo.sina.com.cn/bmiddle/4a5ca024x6491863129df" /></A></P>
<p ALIGN="center">班级首页</P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100cf6n.html#comment</comments>
            <pubDate>Sun, 08 Mar 2009 01:28:01 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100cf6n.html</guid>
        </item>
        <item>
            <title>值对象的问题</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100cbip.html</link>
            <description><![CDATA[<div CLASS="leave floatLeft">
<div>付老，我是关关。<br />
有问题要请教一下，关于formbean/vo/po的问题，按照以往的规则和逻辑，1.action里应该把formbean&nbsp;<wbr />set到vo里，传递到service，然后service里把vo&nbsp;<wbr />set到po里传递到dao里；2.反之，dao把po传给service里，然后在service里，应该po&nbsp;<wbr />set到vo里，然后把vo传递给action；<br />

往往程序员都是吧po直接给service，然后service把po直接给了action，想问一下，按照程序的合理性和复杂性方面，有什么好处还坏处？</DIV>
<div CLASS="commentFrom"></DIV>
<div STYLE="DISPLAY: none" CLASS="revert">
<div CLASS="reply_text">
=========================================================================================</DIV>
</DIV>
</DIV>
<div CLASS="photo"><a><img SRC="http://portrait5.sinaimg.cn/1247584292/blog/50" WIDTH="50" HEIGHT="50" /></A></DIV>
<div>这是一个很常见的疑问，回答如下：</DIV>
<div>一个PO用到底当然方便了，缺点就是不能应付一些复杂的场合。</DIV>
<div><br />
举例：一个修改用户密码的逻辑<br />
<br />
formbean要与web表单一一对应，于是应该可能会有五个属性：用户名，原密码，新密码，重复新密码，图形验证码<br />
<br />
VO（业务层用的值对象），则不需要重复新密码和图形验证码<br />
<br />
PO则不需要原密码</DIV>
<div>&nbsp;</DIV>
<div>这个例子中Formbean - PO - VO就不一一对应，不能一传到底，还可以再设想一些更复杂的场合，呵呵。</DIV>]]></description>
            <author>付老实</author>
            <category>架构技术</category>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100cbip.html#comment</comments>
            <pubDate>Wed, 25 Feb 2009 08:49:51 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100cbip.html</guid>
        </item>
        <item>
            <title>Spring 3.0的更新记录，汗</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100cb51.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;&nbsp;
今儿去springframework溜的时候顺便看了看3.0的更新记录，汗啊，居然一半以上的更新是“去掉了对XXX的支持”，“不再推荐使用XXX”，真正有意义的更新没见几个。也许Change
Log写的不全吧，感觉不到3.0有什么令人惊喜的东西。</P>
<p>&nbsp;</P>
<p>下面是change log全文：</P>
<p>&nbsp;</P>
<p>* revised project layout and build system (module-based sources,
bundle repository)<br />
* updated entire codebase for Java 5 code style (generics, varargs,
StringBuilder)<br />
* updated to JUnit 4.5 and JRuby 1.1<br />
* removed WebLogic 8.1 and WebSphere 5.1 support<br />
* removed native TopLink API support (superseded by JPA)<br />
* removed Commons Attributes support (superseded by Java 5
annotations)<br />
* removed Jakarta JSTL support for JSP 1.2 (superseded by JSP
2.0)<br />
* removed outdated Struts 1.x Action delegation support<br />
* removed ContextLoaderServlet and Log4jConfigServlet<br />
* deprecated form controller hierarchy in favor of @MVC form object
handling<br />
* deprecated JUnit 3.8 test class hierarchy in favor of test
context framework<br />
* introduced Spring EL parser in org.springframework.expression
package<br />
* introduced #{...} expression support in bean definitions<br />
* introduced @Value annotation for embedded expression
support<br />
* introduced @PathVariable annotation for MVC handler methods<br />
* introduced ShallowEtagHeaderFilter<br />
* introduced AbstractAtomFeedView and AbstractRssFeedView<br />
* introduced default value support for @RequestParam<br />
* introduced @RequestHeader annotation for MVC handler
methods<br />
* introduced "spring:url" and "spring:param" JSP tags<br /></P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100cb51.html#comment</comments>
            <pubDate>Tue, 24 Feb 2009 07:48:26 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100cb51.html</guid>
        </item>
        <item>
            <title>Spring 2.5 特性精简介绍</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100cak2.html</link>
            <description><![CDATA[<p>【IoC部分】<br />
<font COLOR="#FF0000">对于Properties属性的设置<br /></FONT>&lt;bean
id="mappings"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;<br />

&nbsp;&nbsp;&nbsp;
&lt;!-- typed as a java.util.Properties
--&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;property name="properties"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;value&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
jdbc.driver.className=com.mysql.jdbc.Driver<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
jdbc.url=jdbc:mysql://localhost:3306/mydb<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/value&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br />
&lt;/bean&gt;</P>
<p>&nbsp;</P>
<p><font COLOR="#FF0000">内部Bean，用于只注入一次的Bean</FONT><br />
&lt;bean id="outer" class="..."&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;property name="target"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;!-- this is the inner bean --&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;bean
class="com.example.Person"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="name" value="Fiona
Apple"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;/bean&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br />
&lt;/bean&gt;</P>
<p>&nbsp;</P>
<p><font COLOR="#FF0000">使用p-namespace简化Bean的属性定义</FONT><br />
&lt;beans xmlns="<a HREF="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</A>"
xmlns:xsi="<a HREF="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>"
xmlns:p="<a HREF="http://www.springframework.org/schema/p">http://www.springframework.org/schema/p</A>"
xsi:schemaLocation="<a HREF="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</A>
<a HREF="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">http://www.springframework.org/schema/beans/spring-beans-2.5.xsd</A>"&gt;<br />

&nbsp;&nbsp;&nbsp;
&lt;!--传统方式--&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;bean name="john-classic"
class="com.example.Person"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="name" value="John
Doe"/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="spouse"
ref="jane"/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;/bean&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;!--时髦方式--&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;bean name="john-modern" class="com.example.Person"
p:name="John Doe" p:spouse-ref="jane"/&gt;</P>
<p>&nbsp;&nbsp;&nbsp;
&lt;bean name="jane"
class="com.example.Person"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="name" value="Jane
Doe"/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;/bean&gt;<br />
&lt;/beans&gt;</P>
<p>&nbsp;</P>
<p><font COLOR="#FF0000">depends-on属性</FONT><br />
depends-on可以显示的声明bean之间的依赖关系，还可以决定bean初始化与销毁的顺序</P>
<p>&nbsp;</P>
<p><font COLOR="#FF0000">PropertyPlaceholderConfigurer</FONT>，如果bean的一些属性不想写在XML配置文件中，可以使用此类写到Properties文件中，方便用户修改。<br />

&lt;bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&gt;<br />

&nbsp;&nbsp;&nbsp;
&lt;property name="locations"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;value&gt;classpath:com/foo/jdbc.properties&lt;/value&gt;<br />

&nbsp;&nbsp;&nbsp;
&lt;/property&gt;<br />
&lt;/bean&gt;<br />
&lt;bean id="dataSource" destroy-method="close"
class="org.apache.commons.dbcp.BasicDataSource"&gt;<br />

&nbsp;&nbsp;&nbsp;
&lt;property name="driverClassName"
value="${jdbc.driverClassName}"/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;property name="url"
value="${jdbc.url}"/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;property name="username"
value="${jdbc.username}"/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;property name="password"
value="${jdbc.password}"/&gt;<br />
&lt;/bean&gt;</P>
<p>下面是Properties文件的内容<br />
jdbc.driverClassName=org.hsqldb.jdbcDriver<br />
jdbc.url=jdbc:hsqldb:hsql://production:9002<br />
jdbc.username=sa<br />
jdbc.password=root</P>
<p>&nbsp;</P>
<p>在Spring 2.5中利用context命名空间，也可以简写如下<br />
&lt;context:property-placeholder
location="classpath:配置文件1,配置文件2"/&gt;</P>
<p>&nbsp;</P>
<p><font COLOR="#FF0000">MessageSources，用来加载资源文件，可实现I18N</FONT><br />
&lt;beans&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;!-- this MessageSource is being used in a web
application --&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource"&gt;<br />

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="basename"
value="test-messages"/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;/bean&gt;</P>
<p>&nbsp;&nbsp;&nbsp;
&lt;bean id="example"
class="com.foo.Example"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;property name="messages"
ref="messageSource"/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;/bean&gt;<br />
&lt;/beans&gt;</P>
<p>&nbsp;</P>
<p><font COLOR="#FF0000">在web.xml中加载ApplicationContext</FONT>，可以使用两种方式：Servlet或ServletListener，后者要求服务器实现Servlet
2.4规范，推荐使用。<br />
&lt;context-param&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;<br />

&nbsp;&nbsp;&nbsp;
&lt;param-value&gt;/WEB-INF/daoContext.xml
/WEB-INF/applicationContext.xml&lt;/param-value&gt;<br />

&lt;/context-param&gt;<br />
&lt;listener&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;<br />

&lt;/listener&gt;</P>
<p>
其中参数contextConfigLocation的值支持ANT风格的通配符，比如/WEB-INF*Context.xml，表示WEB-INF及其子目录下所有以Context.xml结尾的文件</P>
<p>&nbsp;</P>
<p><font COLOR="#FF0000">使用Annotation实现IoC<br /></FONT>首先在配置文件中显式声明需要使用Annotation<br />

&lt;?xml version="1.0"
encoding="UTF-8"?&gt;<br />
&lt;beans xmlns="<a HREF="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</A>"
xmlns:xsi="<a HREF="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</A>"
xmlns:context="<a HREF="http://www.springframework.org/schema/context">http://www.springframework.org/schema/context</A>"
xsi:schemaLocation="<a HREF="http://www.springframework.org/schema/beans">http://www.springframework.org/schema/beans</A>
<a HREF="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">http://www.springframework.org/schema/beans/spring-beans-2.5.xsd</A>
<a HREF="http://www.springframework.org/schema/context">http://www.springframework.org/schema/context</A>
<a HREF="http://www.springframework.org/schema/context/spring-context-2.5.xsd">
http://www.springframework.org/schema/context/spring-context-2.5.xsd</A>"&gt;<br />

&nbsp;&nbsp;&nbsp;
&lt;context:annotation-config/&gt;<br />
&lt;/beans&gt;</P>
<p>
在setter方法前可以使用@Autowired表示自动装配、使用@Required表示属性需要被注入。@Autowired也可以用在非setter方法前、甚至用在构造函数或者属性前。</P>
<p>&nbsp;</P>
<p>如果希望使用by-name注入，可以使用符合JSR-250的@Resource(name="xxxx")</P>
<p>&nbsp;</P>
<p>@Repository, @Service,
@Controller分别对应DAO，Service，控制器。可以用@Service(xxx)的方式给Bean起名字</P>
<p>&nbsp;</P>
<p>自动检测组件&lt;context:component-scan
base-package="org.example"/&gt;，可以用@scope控制实例数量</P>
<p>&nbsp;</P>
<p>&nbsp;</P>
<p><br />
&nbsp;</P>]]></description>
            <author>付老实</author>
            <category>IoC，AOP</category>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100cak2.html#comment</comments>
            <pubDate>Sun, 22 Feb 2009 08:00:40 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100cak2.html</guid>
        </item>
        <item>
            <title>我的笔试/面试题</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100ca44.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;&nbsp;
最近很多模拟和真实的招聘，也出了不少题目，但是很多同学回答的很难让人满意，列举一些，引以为鉴吧。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
<font COLOR="#990000">Q：将身份证号码保存在数据库中，字段应用什么数据类型？</FONT></P>
<p>&nbsp;&nbsp;&nbsp;
令人惊讶的是很多同学回答是int型……稍微好一点的回答是long型…… <img SRC="http://blogimg.sinajs.cn/images/control/face/033.gif" /></P>
<p>&nbsp;&nbsp;&nbsp;
再好一点的回答是String型，可惜大部分数据库中没有String啊</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;终于有人回答varchar、char、nchar或者nvarchar了，但问道这几种类型的区别，又说不上来了。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;<font COLOR="#990000">&nbsp;
Q：要验证一个字符串是否是合法的email地址，需要判断哪些条件？</FONT></P>
<p>&nbsp;&nbsp;&nbsp;
大部分同学可以回答出需要存在字符@和.</P>
<p>&nbsp;&nbsp;&nbsp;
大部分同学都认为email地址必须以.com作为结束&nbsp; <img SRC="http://blogimg.sinajs.cn/images/control/face/033.gif" /></P>
<p>&nbsp;&nbsp;&nbsp;
部分同学回答出@只能出现一次，但是再问如何判断字符串中@只出现了一次，还是很多人答不上来。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
<font COLOR="#990000">Q：如何验证一个字符串是纯英文组成，不包含中文？</FONT></P>
<p>&nbsp;&nbsp;&nbsp;
部分同学可以答出循环取出每一个字符然后判断ASCII码。无其他解法。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
<font COLOR="#990000">Q：HttpServlet中doGet或doPost的方法签名是什么（即传入什么参数，返回什么值）？</FONT></P>
<p>&nbsp;&nbsp;&nbsp;
大部分同学说返回Object，还有说返回ActionForward的…… <img SRC="http://blogimg.sinajs.cn/images/control/face/033.gif" /></P>
<p>&nbsp;&nbsp;&nbsp;
传入的参数也没有几个人能说对。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
<font COLOR="#990000">Q：什么情况下需要使用事务？</FONT></P>
<p>&nbsp;&nbsp;&nbsp;
大部分回答是需要对数据库进行增删改的时候…… <img SRC="http://blogimg.sinajs.cn/images/control/face/033.gif" /></P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;那使用事务的优点呢？使数据库操作更快&nbsp;
<img SRC="http://blogimg.sinajs.cn/images/control/face/033.gif" /></P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
<font COLOR="#990000">Q：Struts中如何对用户输入的数据进行校验？</FONT></P>
<p>&nbsp;&nbsp;&nbsp;
很多同学回答不出。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
<font COLOR="#990000">Q：解释Spring中的IoC和AOP</FONT></P>
<p>&nbsp;&nbsp;&nbsp;
这个就不用说了，可以自行想象。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
没法儿再问了，本来有些问题我怕问出来让对方觉得是在侮辱其智商，可结果总是令人惊讶。我能理解学习编程并不是一件容易的事儿，但是我相当不理解这种不求甚解，敷衍了事的学习态度。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
慢慢的，我觉得我快变成American Idol中评委Simon的角色，在Season
8的海选中，Simon评价一位歌手的表现说“像一只猫从帝国大厦楼顶跳下来，落到地面前发出的声音”，我想，如果这只9条命的猫没有摔死，还能参加程序员的面试，回答结果可能也就是这个水平。</P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100ca44.html#comment</comments>
            <pubDate>Sat, 21 Feb 2009 00:53:29 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100ca44.html</guid>
        </item>
        <item>
            <title>估计是ZhaoLong有史以来最不靠谱的团队</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100c96d.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;&nbsp;
软件工厂成立也有3、4个月了，算上今早刚入职的一共5名员工，真是各有不同啊。下面小小介绍一下：</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
猫妖，又称骡小麻，精神病指数&nbsp; <img SRC="http://product.dangdang.com/images/star_red.gif" /><img SRC="http://product.dangdang.com/images/star_red.gif" /><img SRC="http://product.dangdang.com/images/star_red.gif" /><img SRC="http://product.dangdang.com/images/star_red.gif" /><img SRC="http://product.dangdang.com/images/star_gray.gif" /></P>
<p>&nbsp;&nbsp;&nbsp;
最喜欢的事情：在各大搜索引擎或提供站内全文搜索的网站搜索与猫相关的关键字，如猫食，猫屎，猫砂，猫薄荷……</P>
<p>&nbsp;&nbsp;&nbsp;
恶行：曾抢俺咖啡；过生日请吃饭吃的大家都拉肚子，不过我安然无恙。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
得瑟猫，又称庆庆，精神病指数&nbsp; <img SRC="http://product.dangdang.com/images/star_red.gif" /><img SRC="http://product.dangdang.com/images/star_red.gif" /><img SRC="http://product.dangdang.com/images/star_gray.gif" /><img SRC="http://product.dangdang.com/images/star_gray.gif" /><img SRC="http://product.dangdang.com/images/star_gray.gif" /></P>
<p>&nbsp;&nbsp;&nbsp;
最喜欢的事情：之前没有发现，最近发现貌似是喜欢搬运东西，比如将电脑主机从办公室搬到前台。</P>
<p>&nbsp;&nbsp;&nbsp; 恶行：</P>
<p>&nbsp;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;大猫，暂无其他称号，精神病指数
还待观察，希望不要被带坏</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
侄女，精神病指数&nbsp; <img SRC="http://product.dangdang.com/images/star_red.gif" /><img SRC="http://product.dangdang.com/images/star_gray.gif" /><img SRC="http://product.dangdang.com/images/star_gray.gif" /><img SRC="http://product.dangdang.com/images/star_gray.gif" /><img SRC="http://product.dangdang.com/images/star_gray.gif" /></P>
<p>&nbsp;&nbsp;&nbsp;
最喜欢的事情：貌似是群发短信，经常在聊天中某人说道“那天收到乐乐短信了”，很多人附和道“我也收到了”</P>
<p>&nbsp;&nbsp;&nbsp;
恶行：还以为就我一个叔叔，后来才知道管男员工都叫叔叔。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
还有一个人虽不是我们部门，但也是得介绍一下：</P>
<p>&nbsp;&nbsp;&nbsp;
欢欢，又称表妹，精神病指数 <img SRC="http://product.dangdang.com/images/star_red.gif" /><img SRC="http://product.dangdang.com/images/star_red.gif" /><img SRC="http://product.dangdang.com/images/star_red.gif" /><img SRC="http://product.dangdang.com/images/star_gray.gif" /><img SRC="http://product.dangdang.com/images/star_gray.gif" /></P>
<p>&nbsp;&nbsp;&nbsp;
最喜欢的事情：让瑶瑶管她叫姑姑，不过貌似没有得逞过</P>
<p>&nbsp;&nbsp;&nbsp;
恶行：太多了，罄竹难书了，过几天等此人去新校区开荒后再披露吧。</P>
<p>&nbsp;&nbsp;&nbsp;</P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100c96d.html#comment</comments>
            <pubDate>Wed, 18 Feb 2009 09:55:19 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100c96d.html</guid>
        </item>
        <item>
            <title>Apache + Tomcat 配置1 ： 负载均衡</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100c79y.html</link>
            <description><![CDATA[<p>虽然网上有了很多这方面的资料，但是有些并不完整，所以再画蛇添足一份</P>
<p>目标：将Apache 2.2与Tomcat 6集成，实现负载均衡。（采用Apache
2.2的Proxy_AJP方法，不是JK）</P>
<p>&nbsp;</P>
<p>步骤1：修改Apache 2.2的配置<br />
配置文件为Apache安装目录下的conf/httpd.conf</P>
<p>【1】去掉以下三行的注释，以加载各种插件<br />
LoadModule proxy_module modules/mod_proxy.so<br />
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so<br />
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so</P>
<p>&nbsp;</P>
<p>【2】在文件的最后加上如下内容<br />
ProxyRequests Off<br />
#请求代理，并声明使用Sticky Session<br />
ProxyPass / balancer://tomcatcluster/ lbmethod=byrequests
stickysession=JSESSIONID nofailover=Off timeout=5
maxattempts=3<br />
#反向代理<br />
ProxyPassReverse / balancer://tomcatcluster/</P>
<p>&lt;Proxy
balancer://tomcatcluster&gt;<br />
#所有集群的tomcat服务器在此配置， loadfactor是负载均衡因子， smax是最高负载，
TomcatA、TomcatB是两个tomcat服务器的名字<br />
BalancerMember ajp://localhost:7001 loadfactor=1
route=TomcatA<br />
BalancerMember ajp://localhost:7002 loadfactor=1
route=TomcatB<br />
&lt;/Proxy&gt;</P>
<p>&nbsp;</P>
<p>步骤2，修改Tomcat配置</P>
<p>如果Tomcat服务在不同的机器上，就跳到【2】<br />
【1】修改conf/server.xml中的端口号，避免冲突，至少需要修改SHUTDOWN端口，HTTP端口（也可以屏蔽HTTP端口），AJP端口。还要修改tomcat的名字，比如：<br />

&lt;Server port="8001"
shutdown="SHUTDOWN"&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;Service name="TomcatA"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;Connector port="9001" protocol="HTTP/1.1"
connectionTimeout="20000" redirectPort="8443"
/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;Connector port="7001" protocol="AJP/1.3"
redirectPort="8443" /&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;/Service&gt;<br />
&lt;/Server&gt;</P>
<p>&nbsp;</P>
<p>
【2】修改cluster时session的同步方法，此处使用最简单的session复制法，将session在不同的tomcat实例中复制来复制去（效率自然不高，适合在集群服务器较少的情况下）<br />

只需要将下面配置的注释删除即可<br />
&lt;Cluster
className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/&gt;&nbsp;&nbsp;</P>
<p>&nbsp;</P>
<p>【3】编码时要注意，这时存放在Session中的对象一定要是可序列化的哦</P>
<p>&nbsp;</P>
<p>好了，分别启动Apache和Tomcat测试吧，如果觉得手工刷新麻烦，使用微软的Web Application
Stress可以进行压力测试。<br /></P>]]></description>
            <author>付老实</author>
            <category>表现层技术</category>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100c79y.html#comment</comments>
            <pubDate>Fri, 13 Feb 2009 08:28:24 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100c79y.html</guid>
        </item>
        <item>
            <title>Spring Security笔记（I）</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100c6nt.html</link>
            <description><![CDATA[<p>给一个现有的web应用添加spring security</P>
<p>&nbsp;</P>
<p>
<strong>第一步：修改web.xml文件<br /></STRONG>&lt;filter&gt;<br />

&nbsp;&nbsp;&nbsp;
&lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;<br />

&nbsp;&nbsp;&nbsp;
&lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;<br />

&lt;/filter&gt;<br />
&lt;filter-mapping&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;<br />

&nbsp;&nbsp;&nbsp;
&lt;url-pattern&gt;/*&lt;/url-pattern&gt;<br />

&lt;/filter-mapping&gt;</P>
<p>很显然，增加了一个Servlet Filter，用来拦截所有的web请求</P>
<p>&nbsp;</P>
<p>
<strong>第二步，在spring配置文件中添加&lt;http&gt;节点</STRONG><br />

&lt;http auto-config='true'&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;intercept-url pattern="/**" access="ROLE_USER"
/&gt;<br />
&lt;/http&gt;</P>
<p>这是一个最简单的实例，意思是所有的请求都需要具有User角色，实际中肯定不能这么配置，可以参考这个<br />
&lt;http auto-config="true"&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;intercept-url pattern="/login.jsp*"
filters="none"/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;!--登陆页面不过滤--&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;intercept-url pattern="/*.do"
access="IS_AUTHENTICATED_REMEMBERED"
/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />

&nbsp;&nbsp;&nbsp;
&lt;intercept-url pattern="/**"
access="IS_AUTHENTICATED_ANONYMOUSLY" /&gt;<br />
&lt;/http&gt;</P>
<p>一个完整的http节点是这样的<br />
&lt;http&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;intercept-url pattern="/**" access="ROLE_USER"
/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;form-login
/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;!--指定登陆页面--&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;anonymous /&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;http-basic
/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;!--是否使用HTTP-Basic验证--&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;logout
/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;!--指定logout页面--&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;remember-me
/&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;!--是否启用remember me--&gt;<br />
&lt;/http&gt;</P>
<p>&nbsp;</P>
<p><strong>第三步，指定验证器</STRONG><br />
先来一个最简单、可用来测试的<br />
&lt;authentication-provider&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;user-service&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;user name="tom" password="123"
authorities="ROLE_USER, ROLE_ADMIN" /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;user name="jerry" password="123"
authorities="ROLE_USER" /&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;/user-service&gt;<br />
&lt;/authentication-provider&gt;</P>
<p>如果觉得直接存储密码不合适也可以写成<br />
&lt;authentication-provider&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;password-encoder hash="md5"/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;user-service&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;user name="tom"
password="65d15fe9156f9c4bbffd98085992a44e" authorities="ROLE_USER,
ROLE_ADMIN" /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;user name="jerry"
password="2b58af6dddbd072ed27ffc86725d7d3a" authorities="ROLE_USER"
/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;/user-service&gt;<br />
&lt;/authentication-provider&gt;</P>
<p>
如果想从配置文件中读取用户可以使用&lt;user-service&gt;节点中的properties属性</P>
<p>当然，在实际应用中我们更希望通过数据库验证，你可以这样：<br />
&lt;authentication-provider&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;password-encoder hash="md5"/&gt;<br />
&nbsp;&nbsp;&nbsp;
&lt;jdbc-user-service data-source-ref="dataSource"
/&gt;<br />
&lt;/authentication-provider&gt;<br />
Spring Security会自动通过数据源进行验证，当然你首先要创建几张数据表</P>
<p>也可以这样：<br />
&lt;authentication-provider
user-service-ref='myUserDetailsService'/&gt;<br />
其中myUserDetailsService引用你自己写好的类（要求实现UserDetailsService接口）</P>]]></description>
            <author>付老实</author>
            <category>架构技术</category>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100c6nt.html#comment</comments>
            <pubDate>Wed, 11 Feb 2009 09:15:09 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100c6nt.html</guid>
        </item>
        <item>
            <title>14个技术点</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100c590.html</link>
            <description><![CDATA[&nbsp;&nbsp; &nbsp;准备弄一个项目了，昨天大概列了一下，列举15个技术点，如果有相关经验的可以沟通一下哦
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;1，Https</DIV>
<div>&nbsp;&nbsp;
&nbsp;准备使用Tomcat实现，正在让侄女翻译tomcat文档，估计Shiely抓狂中。</DIV>
<div>&nbsp;&nbsp; &nbsp;</DIV>
<div>&nbsp;&nbsp; &nbsp;2，Excel、Word导入、导出</DIV>
<div>&nbsp;&nbsp;
&nbsp;准备使用POI实现，Excel的导入、导出做的比较多，复杂Word格式的导出应该会比较头疼</DIV>
<div>&nbsp;&nbsp;</DIV>
<div>&nbsp;&nbsp; &nbsp;3，报表</DIV>
<div>&nbsp;&nbsp; &nbsp;比较熟悉BIRT，再对比一下选定报表产品</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;4，权限</DIV>
<div>&nbsp;&nbsp;
&nbsp;肯定需要基于RBAC的，是选择第三方框架，Spring的Acegi，还是自己开发？犹豫中。</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;5，性能监控</DIV>
<div>&nbsp;&nbsp;
&nbsp;因为服务器初定为Tomcat，很多监控就需要自己做了，也需要选择一些监控软件，原先用过JProfile，不知道对B/S程序表现如何。</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;6，邮件发送</DIV>
<div>&nbsp;&nbsp; &nbsp;相对简单</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;7，自定义Spring，Struts加载器</DIV>
<div>&nbsp;&nbsp; &nbsp;为了考虑系统的扩展性，可能需要自行加载Spring，Struts</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;8，制作试用版</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;9，定时器，多线程操作</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;10，数据备份</DIV>
<div>&nbsp;&nbsp; &nbsp;为了兼容不同的数据库，要寻找一种通用的备份方式</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;11，多客户端支持</DIV>
<div>&nbsp;&nbsp; &nbsp;除了浏览器，个别模块可能需要Winforms客户端</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;12，富文本编辑</DIV>
<div>&nbsp;&nbsp; &nbsp;控件很多了，看怎么和程序集成 &nbsp;&nbsp;</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;13，Ajax提交</DIV>
<div>&nbsp;&nbsp; &nbsp;个别表单不能采用Form提交</DIV>
<div><br /></DIV>
<div>&nbsp;&nbsp; &nbsp;14，服务器Cluster</DIV>
<div>&nbsp;&nbsp; &nbsp;这个也是需要考虑的，估计过两天侄女需要继续翻译tomcat文档，吼吼</DIV>]]></description>
            <author>付老实</author>
            <category>架构技术</category>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100c590.html#comment</comments>
            <pubDate>Sat, 07 Feb 2009 01:47:13 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100c590.html</guid>
        </item>
        <item>
            <title>Wii 终于入手了</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100bzv1.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;
前年就想买Wii，后来因为破解问题、经济问题、XX问题，YY问题，ZZ问题……一直没能入手，今天上午终于狠心下手了，韩版Wii软刷 +
一套手柄 + Wii Fit，回家就开始用Wii Fit健身，哈哈。</P>
<p>&nbsp;</P>
<p>
&nbsp;&nbsp;&nbsp;我的BMI是23.67，比我想象的好啊，哈哈。</P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100bzv1.html#comment</comments>
            <pubDate>Sat, 17 Jan 2009 15:18:17 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100bzv1.html</guid>
        </item>
        <item>
            <title>Windows 7</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100by87.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;&nbsp;
第一时间下载了官方放出的Windows 7，傻乎乎的用了微软提供的Download Manager，一共下了10个小时，怒啊。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
因为刻不成DVD，就从网上搜索了不少硬盘安装的方法，挨个儿试验了都不成功。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
最后一怒之下直接解压到硬盘，双击setup.exe安装，成功！<img SRC="http://blogimg.sinajs.cn/images/control/face/022.gif" /></P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
真的不能信专家啊。</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
谈谈用了Windows 7一个小时后的感受：</P>
<p>&nbsp;&nbsp;&nbsp;
1，感觉上速度比Vista快</P>
<p>&nbsp;&nbsp;&nbsp;
2，任务栏中类似于“分组”的排列方式还挺有意思</P>
<p>&nbsp;&nbsp;&nbsp;
3，增加了些实用工具</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
Bug：删除大量文件时会自动忽略操作，需要手工分批删除</P>
<p>&nbsp;&nbsp;&nbsp;
驱动：不认识我的蓝牙鼠标</P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100by87.html#comment</comments>
            <pubDate>Mon, 12 Jan 2009 15:02:59 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100by87.html</guid>
        </item>
        <item>
            <title>还是秀咖啡吧</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100br5c.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;&nbsp;
上次秀了西红柿鸡蛋+荷包蛋炒饭，但是识货的人不多，还是秀秀我擅长的coffee吧，不过这次用的是多鲜的牛奶，做出来的效果打了折扣。</P>
<p>&nbsp;</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;
<a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static11.photo.sina.com.cn/orignal/4a5ca024x6fdaa2b40a0a"><img SRC="http://static11.photo.sina.com.cn/bmiddle/4a5ca024x6fdaa2b40a0a" /></A></P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100br5c.html#comment</comments>
            <pubDate>Sun, 21 Dec 2008 08:27:51 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100br5c.html</guid>
        </item>
        <item>
            <title>老实家秘制炒饭</title>
            <link>http://blog.sina.com.cn/s/blog_4a5ca0240100bqd0.html</link>
            <description><![CDATA[<p>&nbsp;&nbsp;&nbsp;
今天晚上一个在家，要独自搞定晚饭，这当然难不住样样都会的老实，准备做一盘拿手的秘制炒饭，上图，边看边说：</P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp;&nbsp;
先看看原材料，很简单：西红柿、鸡蛋、葱、姜、米饭。摆个造型</P>
<p><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static7.photo.sina.com.cn/orignal/4a5ca024x5e5143007ad6"><img SRC="http://static7.photo.sina.com.cn/bmiddle/4a5ca024x5e5143007ad6" /></A></P>
<p>&nbsp;</P>
<p>&nbsp;&nbsp; 秀秀刀工，把洋葱一顿狠切</P>
<p>
&nbsp;&nbsp;&nbsp;&nbsp;<a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static4.photo.sina.com.cn/orignal/4a5ca024x5e51423cf743"></A><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static7.photo.sina.com.cn/orignal/4a5ca024x5e5143007ad6"></A><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static8.photo.sina.com.cn/orignal/4a5ca024x5e514398ce77"><img SRC="http://static8.photo.sina.com.cn/bmiddle/4a5ca024x5e514398ce77" /></A></P>
<p>洗洗刀，再切西红柿。注意看，我切出来的西红柿是不是很像龙虾呢？</P>
<p><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static8.photo.sina.com.cn/orignal/4a5ca024x5e5144222797"><img SRC="http://static8.photo.sina.com.cn/bmiddle/4a5ca024x5e5144222797" /></A></P>
<p>两个鸡蛋用来做西红柿鸡蛋</P>
<a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static4.photo.sina.com.cn/orignal/4a5ca024x5e51423cf743"></A>
<p><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static12.photo.sina.com.cn/orignal/4a5ca024x5e51452c3e0b"><img SRC="http://static12.photo.sina.com.cn/bmiddle/4a5ca024x5e51452c3e0b" /></A></P>
<p>&nbsp;</P>
<p>搅拌……</P>
<p><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static4.photo.sina.com.cn/orignal/4a5ca024x5e51423cf743"><img SRC="http://static4.photo.sina.com.cn/bmiddle/4a5ca024x5e51423cf743" /></A></P>
<p>调料瓶列队</P>
<p><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static15.photo.sina.com.cn/orignal/4a5ca024x5e51461d603e"><img SRC="http://static15.photo.sina.com.cn/bmiddle/4a5ca024x5e51461d603e" /></A></P>
<p>底料做好了：西红柿炒鸡蛋。很香哦</P>
<p><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static15.photo.sina.com.cn/orignal/4a5ca024x5e5146d5342e"><img SRC="http://static15.photo.sina.com.cn/bmiddle/4a5ca024x5e5146d5342e" /></A></P>
<p>再做一个荷包蛋，一会儿铺在米饭的下面，这叫Save the best for
last。慢慢吃到最后就能遇到了，有挖到宝藏的感觉。</P>
<p><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static11.photo.sina.com.cn/orignal/4a5ca024x5e5149bdf79a"><img SRC="http://static11.photo.sina.com.cn/bmiddle/4a5ca024x5e5149bdf79a" /></A></P>
<p>&nbsp;</P>
<p>炒米饭</P>
<p><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static4.photo.sina.com.cn/orignal/4a5ca024x5e514b296f93"><img SRC="http://static4.photo.sina.com.cn/bmiddle/4a5ca024x5e514b296f93" /></A></P>
<p>导入底料（就是刚才做的西红柿鸡蛋了）</P>
<p><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static8.photo.sina.com.cn/orignal/4a5ca024x5e514bc7c007"><img SRC="http://static8.photo.sina.com.cn/bmiddle/4a5ca024x5e514bc7c007" /></A></P>
<p>出锅喽！色香味俱全，难得一见的炒饭啊。<img SRC="http://blogimg.sinajs.cn/images/control/face/032.gif" /></P>
<p><a TARGET="_blank" href="http://blog.photo.sina.com.cn/showpic.html#url=http://static14.photo.sina.com.cn/orignal/4a5ca024x5e514c42ef5d"><img SRC="http://static14.photo.sina.com.cn/bmiddle/4a5ca024x5e514c42ef5d" /></A></P>]]></description>
            <author>付老实</author>
            <comments>http://blog.sina.com.cn/s/blog_4a5ca0240100bqd0.html#comment</comments>
            <pubDate>Thu, 18 Dec 2008 12:16:51 GMT+8</pubDate>
            <guid>http://blog.sina.com.cn/s/blog_4a5ca0240100bqd0.html</guid>
        </item>
    </channel>
</rss>
