﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-yunshichen-随笔分类-经验心得技巧</title><link>http://www.cnitblog.com/yunshichen/category/8565.html</link><description>我相信人生是值得活的,尽管人在一生中必须遭受痛苦,卑劣,残酷,不幸和死亡的折磨,我依然深信如此.但我认为人生不一定要有意义,只是对一些人而言,他们可以使人生有意义.  ---J 赫胥黎</description><language>zh-cn</language><lastBuildDate>Fri, 03 Feb 2012 04:47:55 GMT</lastBuildDate><pubDate>Fri, 03 Feb 2012 04:47:55 GMT</pubDate><ttl>60</ttl><item><title>Groovy 教程: 入门</title><link>http://www.cnitblog.com/yunshichen/archive/2010/06/05/66498.html</link><dc:creator>Chenyunshi</dc:creator><author>Chenyunshi</author><pubDate>Sat, 05 Jun 2010 07:03:00 GMT</pubDate><guid>http://www.cnitblog.com/yunshichen/archive/2010/06/05/66498.html</guid><wfw:comment>http://www.cnitblog.com/yunshichen/comments/66498.html</wfw:comment><comments>http://www.cnitblog.com/yunshichen/archive/2010/06/05/66498.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnitblog.com/yunshichen/comments/commentRss/66498.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yunshichen/services/trackbacks/66498.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 前言		某年某月某日,正式从python转移到groovy.关于python和groovy的比较,网上已经有许多文章了.我的理由是, 作为一个上了年纪的java程序员,groovy的学习曲线要比python低.毕竟,我只是想用groovy写一些小程序.而这些小程序用java做又太耗时间.希望这篇文章能够帮助java程序员尽快进入groovy世界.预备知识,安装学习groovy最好能熟练用jav...&nbsp;&nbsp;<a href='http://www.cnitblog.com/yunshichen/archive/2010/06/05/66498.html'>阅读全文</a><img src ="http://www.cnitblog.com/yunshichen/aggbug/66498.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yunshichen/" target="_blank">Chenyunshi</a> 2010-06-05 15:03 <a href="http://www.cnitblog.com/yunshichen/archive/2010/06/05/66498.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>软件软性技巧</title><link>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63391.html</link><dc:creator>Chenyunshi</dc:creator><author>Chenyunshi</author><pubDate>Fri, 25 Dec 2009 15:48:00 GMT</pubDate><guid>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63391.html</guid><wfw:comment>http://www.cnitblog.com/yunshichen/comments/63391.html</wfw:comment><comments>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63391.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnitblog.com/yunshichen/comments/commentRss/63391.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yunshichen/services/trackbacks/63391.html</trackback:ping><description><![CDATA[
		<br />
		<h1>问题记录格式</h1>
		<br />从老美那学到的格式,记录开发配置中所遇到的问题.例如当A遇到问题需要B解决时,就可以将之记录下来.这种格式的好处是:<br /><ul><li>责任明确</li></ul><ul><li>时间明确</li></ul><ul><li>是否拖延,一目了然</li></ul><ul><li>提醒自己和对方别浪费时间.</li></ul><br />例如,请看看这个例子<br /><br /><div><table class="zeroBorder" id="xadp" border="0" cellpadding="3" cellspacing="0" height="105" width="1411"><tbody><tr><td width="11%">问题编号<br /></td><td width="11%">问题描述<br /></td><td width="11%">提出者<br /></td><td width="11%">提出时间</td><td width="11%">建议谁来解决<br /></td><td width="11%">状态<br /></td><td width="11%">解决时间<br /></td><td width="11%">实际解决者<br /></td><td width="11%">解决办法<br /></td></tr><tr><td width="11%">1<br /></td><td width="11%">现在我们想达到的效果如下:<br />1)银行对账扫描的是系统真实的a表.<br />2)b公司记录扫描的是经筛选的b表.<br />但一个数据库不能有两个表同名.如何满足我们这个需求?<br /><br /></td><td width="11%">张三<br /></td><td width="11%">2009/03/14</td><td width="11%">李四<br /></td><td width="11%"><b style="color: rgb(255, 0, 0);">open</b><br /></td><td width="11%"><br /></td><td width="11%"><br /></td><td width="11%"><br /></td></tr><tr><td width="11%">2<br /></td><td width="11%">什么时候建好svn或cvs?<br /></td><td width="11%">李四<br /></td><td width="11%">2009/03/14<br /></td><td width="11%">张三<br /></td><td width="11%"><b><span style="color: rgb(56, 118, 29);">closed</span></b><br /></td><td width="11%">2009/03/15<br /></td><td width="11%">张三<br /></td><td width="11%">已经在192.168.1.1上建好svn服务器,连接地址为.....<br /></td></tr></tbody></table></div><br /><br />当然,如果时间允许,可以装类似bug zilla或者jira之类issue tracking工具. 如果实在没时间,就用这个格式先对付着干.<br /><br /><hr size="2" width="100%" /><br /><br /><br /><img src ="http://www.cnitblog.com/yunshichen/aggbug/63391.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yunshichen/" target="_blank">Chenyunshi</a> 2009-12-25 23:48 <a href="http://www.cnitblog.com/yunshichen/archive/2009/12/25/63391.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Hibernate经验心得技巧</title><link>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63390.html</link><dc:creator>Chenyunshi</dc:creator><author>Chenyunshi</author><pubDate>Fri, 25 Dec 2009 15:41:00 GMT</pubDate><guid>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63390.html</guid><wfw:comment>http://www.cnitblog.com/yunshichen/comments/63390.html</wfw:comment><comments>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63390.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yunshichen/comments/commentRss/63390.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yunshichen/services/trackbacks/63390.html</trackback:ping><description><![CDATA[
		<br />
		<hr size="2" />
		<b style="color: rgb(56, 118, 29);">怎样取得hsql的返回值</b>
		<br />
		<br />取多个字段，Hibernate把每个id和name做成一个2个元素的单维数组，List实际上是一个单维数组的集合。
<br /><br />Query q = s.createQuery("select Cat.id, Cat.name, from Cat ");;<br />List l = q.list();;<br />for (int i=0;  i&lt; l.size();; i++); {<br />  Object[] row = (Object[]); l.get(i);;<br />  Long id = (Long); row[0];<br />  String name = (String); row[1];  <br />}<br /><br />在这种情况下，HQL是不会去构造PO的<br /><br /><br /><br /><hr size="2" /><br /><b style="color: rgb(56, 118, 29);">get(find) 和 load的区别</b><br /><br />http://blog.csdn.net/cin_ie/archive/2009/07/13/4345475.aspx<br />http://blog.csdn.net/kunmingkunlun/archive/2008/03/20/2198818.aspx<br /><br />简单总结
<p>总之对于get和load的根本区别，一句话，hibernate对于load方法认为该数据在数据库中一定存在，可以放心的使用代理来延迟加载，如果在使用过程中发现了问题，只能抛异常；而对于get方法，hibernate一定要获取到真实的数据，否则返回null。</p><p><br /></p><p>之所以记下这个主题, 是今天在arm里发现一个很骇人的查询性能问题. 某处程序出错, 原因是该对象的引用对象的父对象id不存在, 于是我随随便便写了个find语句去取出对象. 举例如下</p><p><br /></p><p>A.getB.getC.getId</p><p><br /></p><p>在hbm里, a引用了b,b引用了c. 但因为如果不用lazy的模式,hsql会立刻找出所有的对象关系树. 恰好这几个对象都大量引用了其他对象. 最后就这个小小的操作,居然执行了将近50条sql查询语句! <br /></p><p><br /></p><p>经验总结:</p><p>1) 在查询多表关联的时候,尽量用jdbc. 如果一时贪方便用hsql, 那么也要用query方法而不是直接find,load. 并且做好良好的dao接口. 这样在该方法出现性能问题时,可以在dao实现里修改而不影响业务逻辑. <br /></p><p>2) 侧面证明了把sql/hsql放在dao层的重要性. 对很简单的sql, 放在service和dao的区别不大, 但如果预见到该方法查询的数据多, 可能出现性能问题, 那么尽量将之放到dao. 当然, 这和程序员的经验有关.<br /></p><p><br /></p><hr size="2" /><br /><b style="color: rgb(56, 118, 29);">hibernate 2.1连ORACLE有错，需查看SQL，可是UPDATE或INSERT中的值都被替换成“？”，如何才能显示出完整的SQL呢？</b><br /><br />　　在WEB-INF/classes/log4j.properties添加如下内容： 
<br /><br />　　### log just the SQL
<br />　　log4j.logger.net.sf.hibernate=info
<br />　　### log just the SQL
<br />　　#log4j.logger.net.sf.hibernate.SQL=debug
<br />　　### log JDBC bind parameters ###
<br />　　log4j.logger.net.sf.hibernate.type=debug
      <img src ="http://www.cnitblog.com/yunshichen/aggbug/63390.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yunshichen/" target="_blank">Chenyunshi</a> 2009-12-25 23:41 <a href="http://www.cnitblog.com/yunshichen/archive/2009/12/25/63390.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>杂七杂八的软件技巧</title><link>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63389.html</link><dc:creator>Chenyunshi</dc:creator><author>Chenyunshi</author><pubDate>Fri, 25 Dec 2009 15:40:00 GMT</pubDate><guid>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63389.html</guid><wfw:comment>http://www.cnitblog.com/yunshichen/comments/63389.html</wfw:comment><comments>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63389.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yunshichen/comments/commentRss/63389.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yunshichen/services/trackbacks/63389.html</trackback:ping><description><![CDATA[
		<br />Eclipse<br /><br />不太喜欢<span class="hilite1">Eclipse</span>的鼠标悬停提示功能（主要是变量类型声明和Doc帮助提示），突然弹出的窗口妨碍视线还影响思路，关闭方法如下：
<br /><span style="color: blue;">Window-&gt;Preferences-&gt;Java-&gt;Editor-&gt;Hovers 将[Combined Hover]取消即可</span><br /><br /><br />腾讯的图片验证码地址:<br />http://ptlogin2.qq.com/getimage?aid=15000101&amp;<br /><br />设置wsad启动内存<br />wsad , 到安装目录找到 wsappdev.ini<br />VMArgs=-Xj9 -Xmx1024M<br /><br /><hr size="2" width="100%" /><br /><p>昨天，我以为是机器运行时间太长，重启一下，果然好了。但是今天又来了。看了一下错误提示，我以为是JVM有问题，就在启动Eclipse里加个
JVM的参数，结果还是不行。</p><p>后
来在网上找了一下，有人说是JAVA环境配置的问题，我想这不可能，因为以前一直用的好好的。有人说是JVM的问题，这个我刚刚换了一个，也不是这个问
题，后来看来有人说是：eclipse.ini中内存设置过大的问题，虽然我不以为然，还是试了一下，以前我修改过内存设置，一直都好好的，之前
eclipse.ini的配置如下：</p><blockquote><p>-showsplash<br />com.genuitec.myeclipse.product<br />--launcher.XXMaxPermSize
 <br />512m<br />-vmargs<br />-Xms256m<br />-Xmx512m<br />-Duser.language=en <br />-XX:PermSize=256M
 <br />-XX:MaxPermSize=512M</p></blockquote><p>现在修改了一下，-Xms256m改成-Xms128m，
把Xmx512m  改为 Xmx256m，结果还真的好了，没想到居然是这样的小问题引起来的。</p><img src ="http://www.cnitblog.com/yunshichen/aggbug/63389.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yunshichen/" target="_blank">Chenyunshi</a> 2009-12-25 23:40 <a href="http://www.cnitblog.com/yunshichen/archive/2009/12/25/63389.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>数据库技巧总结</title><link>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63388.html</link><dc:creator>Chenyunshi</dc:creator><author>Chenyunshi</author><pubDate>Fri, 25 Dec 2009 15:39:00 GMT</pubDate><guid>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63388.html</guid><wfw:comment>http://www.cnitblog.com/yunshichen/comments/63388.html</wfw:comment><comments>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63388.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnitblog.com/yunshichen/comments/commentRss/63388.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yunshichen/services/trackbacks/63388.html</trackback:ping><description><![CDATA[
		<br />oracle : 插入单引号 . insert into org_region (reg_id,reg_nom,reg_description) values (111,'rest ''','test')<br /><hr size="2" /><br /><b style="color: rgb(56, 118, 29);">hibernate插入mysql中文乱码问题</b><br /><br />找到my.ini, 修改默认的encoding为gb2312.  <b><span style="color: rgb(0, 0, 255);">注意</span></b>, 原有数据库要删除重建. 许多人就失败在这一步上.<br /><hr size="2" />oracle:合并多行字符串 : <a href="http://czjxdm.javaeye.com/blog/466948">http://czjxdm.javaeye.com/blog/466948</a><br /><br /><hr size="2" width="100%" /><br />tnsnames.ora<br />at path: \ora92\network\admin<br /><br />service_name:<br />means database instance.<br /><img src ="http://www.cnitblog.com/yunshichen/aggbug/63388.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yunshichen/" target="_blank">Chenyunshi</a> 2009-12-25 23:39 <a href="http://www.cnitblog.com/yunshichen/archive/2009/12/25/63388.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java 技巧记录</title><link>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63387.html</link><dc:creator>Chenyunshi</dc:creator><author>Chenyunshi</author><pubDate>Fri, 25 Dec 2009 15:38:00 GMT</pubDate><guid>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63387.html</guid><wfw:comment>http://www.cnitblog.com/yunshichen/comments/63387.html</wfw:comment><comments>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63387.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yunshichen/comments/commentRss/63387.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yunshichen/services/trackbacks/63387.html</trackback:ping><description><![CDATA[
		<br />
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
				<span style="color: rgb(0, 0, 0);">Parser parser </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">new</span>
				<span style="color: rgb(0, 0, 0);"> Parser();<br />       <br />        parser.setURL(address);<br />       <br />        NodeFilter tableFilter </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">new</span>
				<span style="color: rgb(0, 0, 0);"> NodeClassFilter(TableTag.</span>
				<span style="color: rgb(0, 0, 255);">class</span>
				<span style="color: rgb(0, 0, 0);">);<br />       <br />        NodeList list</span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);">parser.extractAllNodesThatMatch(tableFilter);<br />       <br />        String test </span>
				<span style="color: rgb(0, 0, 0);">=</span>
				<span style="color: rgb(0, 0, 0);"> </span>
				<span style="color: rgb(0, 0, 255);">new</span>
				<span style="color: rgb(0, 0, 0);"> String(list.toHtml().getBytes(</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">iso8859-1</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">),</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">gb2312</span>
				<span style="color: rgb(0, 0, 0);">"</span>
				<span style="color: rgb(0, 0, 0);">);<br />        System.out.println(test);</span>
		</div>
		<br />这是我写的一段抓网页的程序, 开始抓回来的数据在ie显示正常, 而在firefox为乱码. 在eclipse里打印也是乱码. 后来将字符串以iso8859-1 转到gb2312, 一切正常.<br /><br />牢记: get和post方式发送请求, 默认就是iso8859-1. 只不过ie隐含的将之转换而已.<br /><br />iso8859-1 我称为结果编码. gb2312称为显示编码. 怎么找这两个编码?<br /><br />1&gt;get和post默认都是iso8859-1, 所以结果编码一般为iso8859-1. 但如果是ajax请求, 则一般为utf-8. 所以可以在两者之间试试. <br />2&gt;显示编码在该网页就能抄到.要不网页也不能正确显示中文.<br /><br />也可以加上:<br /><span style="color: rgb(0, 0, 0);"><br />parser.setEncoding("gb2312");</span><br /><br />省了手动转码的工夫.<br /><hr size="2" width="100%" /><br />//多行记录合并.<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> List generateDataList(HttpServletRequest request) {<br />        List systemOwners </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ArrayList();<br />        List dataList </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ArrayList();<br />        </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />            <br />            systemOwners </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> (List)Manager.GetInstanceSystemOwner(</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">);<br />            List entityList </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> getEntityList();<br />            List regionList </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> getRegionList();<br />            <br />            RoleActeur actor;<br />            Map result </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br />            String instanceId;<br />            String instanceLabel;            <br />            String scopeId;<br />            String scope;<br />            String scopeLabel;<br />            String key</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br />            String lastKey</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br />            String validatorStr</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br />            String sep</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />            </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(Iterator it </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> systemOwners.iterator();it.hasNext();){<br />                actor </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> (RoleActeur)it.next();<br />                instanceId         </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">     actor.getEntiteOrganisationnelle().toString();<br />                instanceLabel     </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">     actor.getInstanceName();<br />                scopeId            </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">    actor.getScopeId().toString();<br />                scope            </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">    actor.getScope();<br />                scopeLabel         </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">     getEntityOrRegionName(scope,scopeId,entityList,regionList);<br />                key </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> instanceId</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">_</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">scopeId</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">_</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">scopeLabel;<br />                <br />                </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);">key.equals(lastKey)){<br />                    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(result</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">){<br />                        dataList.add(result);                                        <br />                    }<br />                    result </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> HashMap();<br />                    result.put(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">IAP_ID</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,instanceId);<br />                    result.put(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">IAP_LIBELLE</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,instanceLabel);<br />                    result.put(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">SCOPE_ID</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,scopeId);<br />                    result.put(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">SCOPE_LABEL</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,scopeLabel);        <br />                    lastKey </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> key;<br />                }<br />                <br />                concateString(result,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">INSTANCE_IDS</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,actor.getIdActeur(),sep);                <br />            }<br />            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(result</span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">){<br />                </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Add the last one.</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                dataList.add(result);                    <br />            }<br />            <br />        }</span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Exception e) {<br />            logger.error(e);<br />        }<br />                <br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> dataList;<br />    }</span></div><br />曾经想过写个接口. 后来想想很难包含其他业务. 干脆先把代码记录下来.<br /><br /><br /><br /><img src ="http://www.cnitblog.com/yunshichen/aggbug/63387.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yunshichen/" target="_blank">Chenyunshi</a> 2009-12-25 23:38 <a href="http://www.cnitblog.com/yunshichen/archive/2009/12/25/63387.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JavaScript 技巧记录</title><link>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63386.html</link><dc:creator>Chenyunshi</dc:creator><author>Chenyunshi</author><pubDate>Fri, 25 Dec 2009 15:33:00 GMT</pubDate><guid>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63386.html</guid><wfw:comment>http://www.cnitblog.com/yunshichen/comments/63386.html</wfw:comment><comments>http://www.cnitblog.com/yunshichen/archive/2009/12/25/63386.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yunshichen/comments/commentRss/63386.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yunshichen/services/trackbacks/63386.html</trackback:ping><description><![CDATA[
		<br />iframe<br />使用iframe的时候, ie6 要在setting里设置浏览器为" 每次都去取新路径. " 要不浏览器就会在缓存取内容. 这样导致的结果就是, 假如iframe里有跳转, 那么只有第一次跳转是对的. 其他时候都显示第一次跳转的内容.<br /><br /><hr size="2" /><br />判断文档加载:(extjs 也是这么做的. 用一个interval函数来反复检查.)<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">document.onreadystatechange </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(){           </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(document.readyState</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">complete</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)           {           alert('加载完毕');         } }</span></div><br /><hr size="2" /><br /><h2><a title="Permanent link to 当ajax遭遇系统错误: -1072896658" rel="bookmark" href="http://www.ooso.net/index.php/archives/167">当ajax遭遇系统错误: -1072896658</a></h2><p>2006-03-13 @ 15:29:24 · 作者 <a title="作者: volcano" href="http://www.ooso.net/index.php/archives/author/volcano/">volcano</a> · 归类于 <a title="查看 PHP 的所有文章" rel="category tag" href="http://www.ooso.net/index.php/archives/category/php/">PHP</a>, <a title="查看 AJAX 的所有文章" rel="category tag" href="http://www.ooso.net/index.php/archives/category/ajax/">AJAX</a>, <a title="查看 JAVASCRIPT 的所有文章" rel="category tag" href="http://www.ooso.net/index.php/archives/category/javascript/">JAVASCRIPT</a></p><div><p>上个礼拜整了个<a href="http://www.ooso.net/index.php/archives/160">ajax调用yahoo搜索的demo</a>,不想有网友发现search.htm会报javascript错 --- <b>系统错误: -1072896658</b>.</p><p>他的服务器环境是apache 2.05+php4.3+ie6/firefox 1.07+windows server
2003,而我的服务器环境是apache 2.2+php5.1.2/php4.3+ie6/firefox
1.07+winxp.这个时候俺几乎就要把所有的错归结到windows server
2003身上了.但是对方可以正常查看我放在网上的demo,所以这跟windows的亲戚应该没太大干系,用-1072896658作为关键字
google了一下,很快有了答案.<br /><a href="http://www.panoramio.com/blog/explorer-system-error-1072896658/">http://www.panoramio.com/blog/explorer-system-error-1072896658/</a></p><p>如果XMLHttpRequest对象请求的文档未指定正确的utf-8编码,就会出现这个错误<br /><b>浏览器系统错误:-1072896658</b>(Explorer system error: -1072896658)</p><p>解决办法很简单,给代理proxy.php加上简单的一行就一切ok:</p><div><div style="border: 0.5pt solid windowtext; background: rgb(230, 230, 230) none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;"><div><img style="width: 11px; height: 16px;" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /><span style="color: rgb(0, 128, 128);">header</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">text/javascript; charset=utf-8</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">); </span></div><div><span style="color: rgb(0, 0, 0);">或</span></div><div><span style="color: rgb(0, 0, 0);"><font size="2"><font color="#c60a00">header</font>('<font color="#c60a00">Content-Type:</font><font color="#c60a00">text</font>/html; charset=utf-8');</font></span></div><div><span style="color: rgb(0, 0, 0);"><font size="2">或</font></span></div><div><span style="color: rgb(0, 0, 0);">&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;</span></div></div></div></div><br /><br /><hr size="2" /><br /><br /><br /><br /><br /><img src ="http://www.cnitblog.com/yunshichen/aggbug/63386.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yunshichen/" target="_blank">Chenyunshi</a> 2009-12-25 23:33 <a href="http://www.cnitblog.com/yunshichen/archive/2009/12/25/63386.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ext2.2 教程二:MessageBox例子</title><link>http://www.cnitblog.com/yunshichen/archive/2009/04/15/56387.html</link><dc:creator>Chenyunshi</dc:creator><author>Chenyunshi</author><pubDate>Wed, 15 Apr 2009 03:54:00 GMT</pubDate><guid>http://www.cnitblog.com/yunshichen/archive/2009/04/15/56387.html</guid><wfw:comment>http://www.cnitblog.com/yunshichen/comments/56387.html</wfw:comment><comments>http://www.cnitblog.com/yunshichen/archive/2009/04/15/56387.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yunshichen/comments/commentRss/56387.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yunshichen/services/trackbacks/56387.html</trackback:ping><description><![CDATA[改写自下载包里自带的例子.<br /><br />jsp:<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"><![CDATA[<%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">@ page language</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">java</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> contentType</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">text/html; charset=UTF-8</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%>]]&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">jsp:include </span><span style="color: rgb(255, 0, 0);">page</span><span style="color: rgb(0, 0, 255);">="/jsp/globalConfig.jsp"</span><span style="color: rgb(0, 0, 255);">&gt;span style="color: rgb(128, 0, 0);"&gt;jsp:include</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">html</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">head</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">MessageBox Samples</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;title</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">script </span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="text/javascript"</span><span style="color: rgb(255, 0, 0);"> src</span><span style="color: rgb(0, 0, 255);">="js/mbsample.js"</span><span style="color: rgb(0, 0, 255);">&gt;span style="color: rgb(128, 0, 0);"&gt;script</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">style </span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="text/css"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="background-color: rgb(245, 245, 245); color: rgb(128, 0, 0);"><br />    .x-window-dlg .ext-mb-download </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">{</span><span style="background-color: rgb(245, 245, 245); color: rgb(255, 0, 0);"><br />        background</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">:</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">transparent url(images/download.gif) no-repeat top left</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">;</span><span style="background-color: rgb(245, 245, 245); color: rgb(255, 0, 0);"><br />        height</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">:</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">46px</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">;</span><span style="background-color: rgb(245, 245, 245); color: rgb(255, 0, 0);"><br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">}</span><span style="background-color: rgb(245, 245, 245); color: rgb(128, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;style</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;head</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">body</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">h1</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">MessageBox 对话框</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;h1</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">The example shows how to use the MessageBox class. Some of the buttons have animations, some are normal.</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">The js is not minified so it is readable. See </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="js/mbsample.js"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Message-sample..js</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;a</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Confirm</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;b</span><span style="color: rgb(0, 0, 255);">&gt;&lt;&lt;/span&gt;<span style="color: rgb(128, 0, 0);">br </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />    Standard Yes/No dialog.<br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">button </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="mb1"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Show</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;button</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Prompt</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;b</span><span style="color: rgb(0, 0, 255);">&gt;&lt;&lt;/span&gt;<span style="color: rgb(128, 0, 0);">br </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />    Standard prompt dialog.<br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">button </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="mb2"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Show</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;button</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Multi-line Prompt</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;b</span><span style="color: rgb(0, 0, 255);">&gt;&lt;&lt;/span&gt;<span style="color: rgb(128, 0, 0);">br </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />    A multi-line prompt dialog.<br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">button </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="mb3"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Show</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;button</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Yes/No/Cancel</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;b</span><span style="color: rgb(0, 0, 255);">&gt;&lt;&lt;/span&gt;<span style="color: rgb(128, 0, 0);">br </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />    Standard Yes/No/Cancel dialog.<br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">button </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="mb4"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Show</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;button</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Progress Dialog</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;b</span><span style="color: rgb(0, 0, 255);">&gt;&lt;&lt;/span&gt;<span style="color: rgb(128, 0, 0);">br </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />    Dialog with measured progress bar.<br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">button </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="mb6"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Show</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;button</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Wait Dialog</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;b</span><span style="color: rgb(0, 0, 255);">&gt;&lt;&lt;/span&gt;<span style="color: rgb(128, 0, 0);">br </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />    Dialog with indefinite progress bar and custom icon (will close after 8 sec).<br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">button </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="mb7"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Show</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;button</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Alert</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;b</span><span style="color: rgb(0, 0, 255);">&gt;&lt;&lt;/span&gt;<span style="color: rgb(128, 0, 0);">br </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />    Standard alert message dialog.<br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">button </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="mb8"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Show</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;button</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Icons</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;b</span><span style="color: rgb(0, 0, 255);">&gt;&lt;&lt;/span&gt;<span style="color: rgb(128, 0, 0);">br </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />    Standard alert with optional icon.<br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">select </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="icons"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">option </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="error"</span><span style="color: rgb(255, 0, 0);"> selected</span><span style="color: rgb(0, 0, 255);">="selected"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Error</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;option</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">option </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="info"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Informational</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;option</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">option </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="question"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Question</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;option</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">option </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="warning"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Warning</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;option</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;select</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">button </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="mb9"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">Show</span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;button</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;body</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">span style="color: rgb(128, 0, 0);"&gt;html</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span></span></span></span></span></span></span></span></span></div><br />mbsample.js:<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"><br /> * Ext JS Library 2.2.1<br /> * Copyright(c) 2006-2009, Ext JS, LLC.<br /> * licensing@extjs.com<br /> * <br /> * http://extjs.com/license<br /> </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /><br />Ext.onReady(</span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(){<br />    Ext.get('mb1').on('click', </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(e){<br />        Ext.MessageBox.confirm('Confirm', 'Are you sure you want to </span><span style="color: rgb(0, 0, 255);">do</span><span style="color: rgb(0, 0, 0);"> that</span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);">', showResult);<br />    });<br /><br />    Ext.get('mb2').on('click', </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(e){<br />        Ext.MessageBox.prompt('Name', 'Please enter your name:', showResultText);<br />    });<br /><br />    Ext.get('mb3').on('click', </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(e){<br />        Ext.MessageBox.show({<br />           title: 'Address',<br />           msg: 'Please enter your address:',<br />           width:</span><span style="color: rgb(0, 0, 0);">300</span><span style="color: rgb(0, 0, 0);">,<br />           buttons: Ext.MessageBox.OKCANCEL,<br />           multiline: </span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">,<br />           fn: showResultText,<br />           animEl: 'mb3'<br />       });<br />    });<br /><br />    Ext.get('mb4').on('click', </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(e){<br />        Ext.MessageBox.show({<br />           title:'Save Changes</span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);">',<br />           msg: 'You are closing a tab that has unsaved changes. </span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);">br </span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);">Would you like to save your changes</span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);">',<br />           buttons: Ext.MessageBox.YESNOCANCEL,<br />           fn: showResult,<br />           animEl: 'mb4',<br />           icon: Ext.MessageBox.QUESTION<br />       });<br />    });<br /><br />    Ext.get('mb6').on('click', </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(){<br />        Ext.MessageBox.show({<br />           title: 'Please wait',<br />           msg: 'Loading items<img src="http://www.cnitblog.com/images/dot.gif" />',<br />           progressText: 'Initializing<img src="http://www.cnitblog.com/images/dot.gif" />',<br />           width:</span><span style="color: rgb(0, 0, 0);">300</span><span style="color: rgb(0, 0, 0);">,<br />           progress:</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">,<br />           closable:</span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">,<br />           animEl: 'mb6'<br />       });<br /><br />       </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);"> this hideous block creates the bogus progress</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">       </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> f </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(v){<br />            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(){<br />                </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(v </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">12</span><span style="color: rgb(0, 0, 0);">){<br />                    Ext.MessageBox.hide();<br />                    Ext.example.msg('Done', 'Your fake items were loaded</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);">');<br />                }</span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);">{<br />                    </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> v</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">11</span><span style="color: rgb(0, 0, 0);">;<br />                    Ext.MessageBox.updateProgress(i, Math.round(</span><span style="color: rgb(0, 0, 0);">100</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">i)</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);"> completed');<br />                }<br />           };<br />       };<br />       </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">; i </span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">13</span><span style="color: rgb(0, 0, 0);">; i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">){<br />           setTimeout(f(i), i</span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">500</span><span style="color: rgb(0, 0, 0);">);<br />       }<br />    });<br /><br />    Ext.get('mb7').on('click', </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(){<br />        Ext.MessageBox.show({<br />           msg: 'Saving your data, please wait<img src="http://www.cnitblog.com/images/dot.gif" />',<br />           progressText: 'Saving<img src="http://www.cnitblog.com/images/dot.gif" />',<br />           width:</span><span style="color: rgb(0, 0, 0);">300</span><span style="color: rgb(0, 0, 0);">,<br />           wait:</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">,<br />           waitConfig: {interval:</span><span style="color: rgb(0, 0, 0);">200</span><span style="color: rgb(0, 0, 0);">},<br />           icon:'ext</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">mb</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">download', </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">custom class in msg-box.html</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">           animEl: 'mb7'<br />       });<br />        setTimeout(</span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(){<br />            </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">This simulates a long-running operation like a database save or XHR call.</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">            </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">In real code, this would be in a callback function.</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">            Ext.MessageBox.hide();<br />            </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Ext.example.msg('Done', 'Your fake data was saved!');</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">        }, </span><span style="color: rgb(0, 0, 0);">8000</span><span style="color: rgb(0, 0, 0);">);<br />    });<br /><br />    Ext.get('mb8').on('click', </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(){<br />        Ext.MessageBox.alert('Status', 'Changes saved successfully.', showResult);<br />    });<br /><br />    </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Add these values dynamically so they aren't hard-coded in the html</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">    Ext.fly('info').dom.value </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Ext.MessageBox.INFO;<br />    Ext.fly('question').dom.value </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Ext.MessageBox.QUESTION;<br />    Ext.fly('warning').dom.value </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Ext.MessageBox.WARNING;<br />    Ext.fly('error').dom.value </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Ext.MessageBox.ERROR;<br /><br />    Ext.get('mb9').on('click', </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">(){<br />        Ext.MessageBox.show({<br />           title: 'Icon Support',<br />           msg: 'Here is a message </span><span style="color: rgb(0, 0, 255);">with</span><span style="color: rgb(0, 0, 0);"> an icon</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);">',<br />           buttons: Ext.MessageBox.OK,<br />           animEl: 'mb9',<br />           fn: showResult,<br />           icon: Ext.get('icons').dom.value<br />       });<br />    });<br /><br />    </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);"> showResult(btn){<br />        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Ext.example.msg('Button Click', 'You clicked the {0} button', btn);</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">    };<br /><br />    </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);"> showResultText(btn, text){<br />        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">Ext.example.msg('Button Click', 'You clicked the {0} button and entered the text "{1}".', btn, text);</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">    };<br />});</span></div><br /><br /><br /><img src ="http://www.cnitblog.com/yunshichen/aggbug/56387.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yunshichen/" target="_blank">Chenyunshi</a> 2009-04-15 11:54 <a href="http://www.cnitblog.com/yunshichen/archive/2009/04/15/56387.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ext2.2 教程一:预备走</title><link>http://www.cnitblog.com/yunshichen/archive/2009/04/15/56002.html</link><dc:creator>Chenyunshi</dc:creator><author>Chenyunshi</author><pubDate>Wed, 15 Apr 2009 02:08:00 GMT</pubDate><guid>http://www.cnitblog.com/yunshichen/archive/2009/04/15/56002.html</guid><wfw:comment>http://www.cnitblog.com/yunshichen/comments/56002.html</wfw:comment><comments>http://www.cnitblog.com/yunshichen/archive/2009/04/15/56002.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/yunshichen/comments/commentRss/56002.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/yunshichen/services/trackbacks/56002.html</trackback:ping><description><![CDATA[
		<br />
		<h3>
				<b>
						<font color="#009900">一 简介</font>
				</b>
		</h3>Ext 是目前最火爆的javascript框架. 原名yui-ext,是yahoo yui的补充, 后来另起炉灶,名字也更改为ExtJs.最新版本是2.2.1,你可以从这里下载:<a target="_blank" title="Ext2 下载" href="http://extjs.com/products/extjs/download.php?dl=extjs221">http://extjs.com/products/extjs/download.php?dl=extjs221</a><br /><br />YUI和Ext各有优缺点. 论开发的灵活度和性能,YUI更好. 论集成功能之多和界面漂亮,Ext更胜一筹.如果你是一个纯粹的开发人员,美工水平一般,那么用ExtJs来开发网站实在再好不过,你可以借助ExtJs自身类库实现许多很酷很炫的效果.<br /><br /><h3><b><font><b><font color="#009900">二 起步</font></b></font></b></h3>和YUI的大气不同,Ext是想在市场上赚点银子的.所以Ext的官方文档/资源相比YUI来说较为缺乏,入门不易.如果想要学习Ext,建议从以下几步着手:<br /><ul><li>查看Ext例子.下载完Ext后打开下载包,里面的examples目录有许多示范例子,尽自己能力改写这些例子,就能更快掌握Ext</li><li>查看api文档.在下载包的docs目录里有api文档可供查看.</li><li>借助firebug阅读源码.源码在下载包的source目录里.</li><li>安装spket eclipse插件.这样在eclipse里写js时就可以有code assistant功能.在这个视频里你可以看到这个功能是多么的酷:<a href="http://www.spket.com/demos/js.html" target="_blank">http://www.spket.com/demos/js.<wbr>html</wbr></a>  参考这篇文章进行安装:<a target="_blank" title="在spket里如何安装Ext2" href="http://www.blogjava.net/H-bomb/archive/2008/02/02/179051.html">http://www.blogjava.net/H-bomb/archive/2008/02/02/179051.html<br /></a></li><li>多动手,多总结.<br /></li></ul><h3><b><font><b><font><b><font><b><font color="#009900">三 实例的代码结构</font></b></font></b></font></b></font></b></h3>教程的源程序按照jsp的war格式进行组织,目录结构如下:<br /><br /><img src="http://www.cnitblog.com/images/cnitblog_com/yunshichen/2009-04-15-100356_346x551_scrot.png" alt="2009-04-15-100356_346x551_scrot.png" width="346" border="0" height="551" /><br /><br />globalConfig.jsp 的内容:<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><br /></span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);"><![CDATA[<%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">--</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> Ext config . </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">--</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%>]]&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">link </span><span style="color: rgb(255, 0, 0);">rel</span><span style="color: rgb(0, 0, 255);">="stylesheet"</span><span style="color: rgb(255, 0, 0);"> type</span><span style="color: rgb(0, 0, 255);">="text/css"</span><span style="color: rgb(255, 0, 0);"> href</span><span style="color: rgb(0, 0, 255);">="&lt;%=request.getContextPath()%&gt;/js/ext-2.2.1/resources/css/ext-all.css"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">script </span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="text/javascript"</span><span style="color: rgb(255, 0, 0);"> src</span><span style="color: rgb(0, 0, 255);">="&lt;%=request.getContextPath()%&gt;/js/ext-2.2.1/adapter/ext/ext-base.js"</span><span style="color: rgb(0, 0, 255);">&gt;span style="color: rgb(128, 0, 0);"&gt;script</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);"></span><span style="color: rgb(128, 0, 0);">script </span><span style="color: rgb(255, 0, 0);">type</span><span style="color: rgb(0, 0, 255);">="text/javascript"</span><span style="color: rgb(255, 0, 0);"> src</span><span style="color: rgb(0, 0, 255);">="&lt;%=request.getContextPath()%&gt;/js/ext-2.2.1/ext-all.js"</span><span style="color: rgb(0, 0, 255);">&gt;span style="color: rgb(128, 0, 0);"&gt;script</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span></div><br /><br /><br /><img src ="http://www.cnitblog.com/yunshichen/aggbug/56002.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/yunshichen/" target="_blank">Chenyunshi</a> 2009-04-15 10:08 <a href="http://www.cnitblog.com/yunshichen/archive/2009/04/15/56002.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>