??xml version="1.0" encoding="utf-8" standalone="yes"?>快乐12:BlogJava - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/vip01/用优雅的设计解决丑陋的问?/description>zh-cnMon, 15 Oct 2018 09:35:29 GMTMon, 15 Oct 2018 09:35:29 GMT60原创小技巧解决list做strtus2标签checkboxlist默认值无法选中的问?/title><link>//www.ot7t.com.cn/vip01/archive/2010/12/02/339602.html</link><dc:creator>交口称赞</dc:creator><author>交口称赞</author><pubDate>Thu, 02 Dec 2010 06:09:00 GMT</pubDate><guid>//www.ot7t.com.cn/vip01/archive/2010/12/02/339602.html</guid><wfw:comment>//www.ot7t.com.cn/vip01/comments/339602.html</wfw:comment><comments>//www.ot7t.com.cn/vip01/archive/2010/12/02/339602.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>//www.ot7t.com.cn/vip01/comments/commentRss/339602.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/vip01/services/trackbacks/339602.html</trackback:ping><description><![CDATA[<span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">用struts2的标签checkboxlist可以很方便的用生成checkbox?但是让其默认选中指定checkbox却是非常麻烦.</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">之前?种方?</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">第一种是修改struts2 tag的源代码.</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">比如//jolestar.javaeye.com/blog/160360</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">第二种就是彻底妥?在action里面把list bean转成数组,赋给checkboxlist的value属?</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">这两种solution都不是那么优?作为一个有房贷没希望的IT民工我不禁问自己:</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">怎么能对自己的要求这么低? 怎么能应付了事呢?</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">翻文?研究了下ognl的语?终于让我找到了一种方便的写法.</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">JavaBean</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span> <div class="dp-highlighter" style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace; font-size: 12px; background-color: transparent; width: 766px; overflow-x: auto; overflow-y: auto; margin-left: 9px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; word-break: break-all; word-wrap: break-word; line-height: 18px; "> <ol start="1" class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; "> <li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span class="keyword" style="color: #7f0055; font-weight: bold; ">public</span><span style="color: black; "> </span><span class="keyword" style="color: #7f0055; font-weight: bold; ">class</span><span style="color: black; "> Operate </span><span class="keyword" style="color: #7f0055; font-weight: bold; ">extends</span><span style="color: black; "> BaseBean {  </span></span></li> <li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">    <span class="keyword" style="color: #7f0055; font-weight: bold; ">private</span><span style="color: black; "> </span><span class="keyword" style="color: #7f0055; font-weight: bold; ">long</span><span style="color: black; "> id;  </span></span></li> <li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">    <span class="keyword" style="color: #7f0055; font-weight: bold; ">private</span><span style="color: black; "> String name;  </span></span></li> <li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; ">}  </span></li> </ol> </div> <span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">Action中初始化allOpList和myOpList.</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span> <div class="dp-highlighter" style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace; font-size: 12px; background-color: transparent; width: 766px; overflow-x: auto; overflow-y: auto; margin-left: 9px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; word-break: break-all; word-wrap: break-word; line-height: 18px; "> <ol start="1" class="dp-j" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; "> <li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span class="keyword" style="color: #7f0055; font-weight: bold; ">private</span><span style="color: black; "> List<Operate> myOpList;  </span></span></li> <li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span class="keyword" style="color: #7f0055; font-weight: bold; ">private</span><span style="color: black; "> List<Operate> allOpList;  </span></span></li> </ol> </div> <span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">前台jsp用strtus2标签生成checkboxlist</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span> <div class="dp-highlighter" style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', Consolas, 'Courier New', monospace; font-size: 12px; background-color: transparent; width: 766px; overflow-x: auto; overflow-y: auto; margin-left: 9px; padding-top: 1px; padding-right: 1px; padding-bottom: 1px; padding-left: 1px; word-break: break-all; word-wrap: break-word; line-height: 18px; "> <ol start="1" class="dp-xml" style="font-size: 1em; line-height: 1.4em; margin-top: 0px; margin-right: 0px; margin-bottom: 1px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 2px; padding-left: 0px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #d1d7dc; border-right-color: #d1d7dc; border-bottom-color: #d1d7dc; border-left-color: #d1d7dc; list-style-type: decimal; list-style-position: initial; list-style-image: initial; background-color: #ffffff; color: #2b91af; "> <li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span class="tag" style="color: #006699; font-weight: bold; "><</span><span class="tag-name" style="color: #006699; font-weight: bold; ">s:checkboxlist</span><span style="color: black; "> </span><span class="attribute" style="color: red; ">name</span><span style="color: black; ">=</span><span class="attribute-value" style="color: blue; ">"myOpList.id"</span><span style="color: black; "> </span><span class="attribute" style="color: red; ">list</span><span style="color: black; ">=</span><span class="attribute-value" style="color: blue; ">"allOpList"</span><span style="color: black; "> </span><span class="attribute" style="color: red; ">listValue</span><span style="color: black; ">=</span><span class="attribute-value" style="color: blue; ">"name"</span><span style="color: black; ">  </span><span class="attribute" style="color: red; ">listKey</span><span style="color: black; ">=</span><span class="attribute-value" style="color: blue; ">"id"</span><span style="color: black; ">   </span></span></li> <li style="font-size: 1em; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 38px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 10px; border-left-width: 1px; border-left-style: solid; border-left-color: #d1d7dc; background-color: #fafafa; line-height: 18px; "><span style="color: black; "><span class="attribute" style="color: red; ">value</span><span style="color: black; ">=</span><span class="attribute-value" style="color: blue; ">"myOpList.{#this.id}"</span><span class="tag" style="color: #006699; font-weight: bold; ">/></span><span style="color: black; ">  </span></span></li> </ol> </div> <span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">checkboxlist标签用allOpList的内容生成checkbox, 并且用myOpList的值选中默认.</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">并且当页面提交的时?又能自动把checkbox的选中情况,赋给myOpList.Operate.id属?</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">这样从后到前到再到后,全都是用list bean去完?用法统一,不要转换,全部操作的是bean而不是数?</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">精华在于</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><span style="color: red; ">myOpList.{#this.id}</span></span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">这个ognl表达?自动生成[4, 11]这种格式的数?</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">引申一?ognl的语法强大到可以myOpList.{?#this.enable > 0}来做过滤,看着有点Jquery的味?非常好用.</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">有同志会?这种过滤没有什么意?不如在后台sql里面?</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">假设一个应用场?</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">全部用户信息是放在cache里面的list,根据前一个页面来过滤男女,然后显示.</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">这时候这个过滤表达式就发挥作用了,不用您在后台一个一个过滤重新组装list?</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">userInfoist.{?#this.sex > 0}</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">简洁而优?这下能过自己这关?</span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "> </span><span style="font-family: Tahoma; font-size: 12px; line-height: 18px; "><br /> </span><br /> <font face="Tahoma" size="3"><span style="font-size: 12px; line-height: 18px;"><br /> </span></font> <img src ="//www.ot7t.com.cn/vip01/aggbug/339602.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/vip01/" target="_blank">交口称赞</a> 2010-12-02 14:09 <a href="//www.ot7t.com.cn/vip01/archive/2010/12/02/339602.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ColdFusion实用技?/title><link>//www.ot7t.com.cn/vip01/archive/2008/10/29/237391.html</link><dc:creator>交口称赞</dc:creator><author>交口称赞</author><pubDate>Wed, 29 Oct 2008 07:49:00 GMT</pubDate><guid>//www.ot7t.com.cn/vip01/archive/2008/10/29/237391.html</guid><wfw:comment>//www.ot7t.com.cn/vip01/comments/237391.html</wfw:comment><comments>//www.ot7t.com.cn/vip01/archive/2008/10/29/237391.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.ot7t.com.cn/vip01/comments/commentRss/237391.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/vip01/services/trackbacks/237391.html</trackback:ping><description><![CDATA[最近做了一个ColdFusion的项目,收益颇多?br /><br />其中也碰到了一些bt的需求,结合项目把一些小技巧和大家分享一下(一? ColdFusion经验的菜鸟被赶鸭子上架的搞了几天心得,如果你认为简单的可笑欢迎指教,乱喷党请绕行)<br /><br />先来点小?br /><br /><ul class="yibqv"><li class="yibqv">ColdFusion使用ajax(ColdFusion返回json格式的数据)</li></ul>用惯了jquery,直接无视ColdFusion的ajax。既然用jquery,当然希望后台返回json格式的数据?br />找了一下coldfusion 8已经提供非常方便的api?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>//www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">cfinvoke </span><span style="color: rgb(255, 0, 0);">component</span><span style="color: rgb(0, 0, 255);">="CsmDashboard"</span><span style="color: rgb(255, 0, 0);"> method</span><span style="color: rgb(0, 0, 255);">="getCsTableSum"</span><span style="color: rgb(255, 0, 0);"> timerange</span><span style="color: rgb(0, 0, 255);">="#timerange#"</span><span style="color: rgb(255, 0, 0);"> <br />wherestr</span><span style="color: rgb(0, 0, 255);">="#wherestr#"</span><span style="color: rgb(255, 0, 0);"> returnVariable</span><span style="color: rgb(0, 0, 255);">="tableSum"</span><span style="color: rgb(0, 0, 255);">/></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);">cfscript</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />    writeOutput(SerializeJSON(#tableSum#));<br /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">cfscript</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span></div><span style="color: rgb(0, 0, 0);">writeOutput(SerializeJSON(#tableSum#));这句会把查询结果</span><span style="color: rgb(0, 0, 0);">tableSum序列化成json格式传给前台?br /><br /></span><ul class="yibqv"><li class="yibqv">ColdFusion不自动转义参?/li></ul>PreserveSingleQuotes(name),ColdFusion为了安全,会自动转义参数中的特殊字符。特殊情况下我们不希望他这样做,就可以用上面的方法?br /><br /><ul class="yibqv"><li class="yibqv">ColdFusion字符串比较,以XX结尾</li></ul><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">cfif </span><span style="color: rgb(255, 0, 0);">Right(ListGetAt(nameList,LoopCount),2) eq "sp"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /></span><ul class="yibqv"><li class="yibqv">取整<span style="color: rgb(0, 0, 255);"> NumberFormat</span></li></ul><br /><ul class="yibqv"><li class="yibqv"><span style="color: rgb(0, 0, 255);"></span>取list长度 listLen</li></ul><br /><ul class="yibqv"><li class="yibqv">取list第几个ListGetAt</li></ul><br /><ul class="yibqv"><li class="yibqv">查询结果字段列表 query.columnlis </li></ul><br /><ul class="yibqv"><li class="yibqv">查询结果集某个字段的第几?query.columnname[i]#<br /></li></ul><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>//www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">cfset </span><span style="color: rgb(255, 0, 0);">nameList </span><span style="color: rgb(0, 0, 255);">= "Calls,CALLSP,Duration,......................................................"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </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);">CFOUTPUT </span><span style="color: rgb(255, 0, 0);">query</span><span style="color: rgb(0, 0, 255);">="csmSum"</span><span style="color: rgb(0, 0, 255);">></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);">cfloop </span><span style="color: rgb(255, 0, 0);">index </span><span style="color: rgb(0, 0, 255);">= "LoopCount"</span><span style="color: rgb(255, 0, 0);"> from</span><span style="color: rgb(0, 0, 255);">="1"</span><span style="color: rgb(255, 0, 0);"> to</span><span style="color: rgb(0, 0, 255);">="#ListLen(nameList)#"</span><span style="color: rgb(0, 0, 255);">></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);">cfset </span><span style="color: rgb(255, 0, 0);">tmp </span><span style="color: rgb(0, 0, 255);">=NumberFormat(Evaluate("querylist." </span><span style="color: rgb(255, 0, 0);">& ListGetAt(nameList,LoopCount)),0.00)</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />                  </span><span style="color: rgb(0, 0, 0);">          </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">td </span><span style="color: rgb(255, 0, 0);">class</span><span style="color: rgb(0, 0, 255);">="num"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">#tmp#</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">></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);">cfloop</span><span style="color: rgb(0, 0, 255);">></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);">CFOUTPUT</span><span style="color: rgb(0, 0, 255);">></span></div><br />ColdFusion只能根据一个变量名称取取查询结果的字段,没有根据位置或者字符串取,非常不爽?br /><br />核心就是?span style="color: rgb(0, 0, 255);">Evaluate根据一个字符串去动态构造一个变量,</span>然后根据这个变量取出query中的列?br />个这个字符串可以从一个list里面动态循环取出来再拼凑而成<br />而这个list可以从一些地方查询或者传递过来?br />所以表格就动态了起来?br /><br /><br /><br /><br /><br /><img src ="//www.ot7t.com.cn/vip01/aggbug/237391.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/vip01/" target="_blank">交口称赞</a> 2008-10-29 15:49 <a href="//www.ot7t.com.cn/vip01/archive/2008/10/29/237391.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Java6(一) WebServices (8)Web Service Security - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/vip01/archive/2008/06/02/205294.html交口称赞交口称赞Mon, 02 Jun 2008 04:09:00 GMT//www.ot7t.com.cn/vip01/archive/2008/06/02/205294.html//www.ot7t.com.cn/vip01/comments/205294.html//www.ot7t.com.cn/vip01/archive/2008/06/02/205294.html#Feedback2//www.ot7t.com.cn/vip01/comments/commentRss/205294.html//www.ot7t.com.cn/vip01/services/trackbacks/205294.html阅读全文

交口称赞 2008-06-02 12:09 发表评论
]]>
学习Java6(一) WebServices (7)传递集合对象终极解决方?/title><link>//www.ot7t.com.cn/vip01/archive/2008/05/28/128075.html</link><dc:creator>交口称赞</dc:creator><author>交口称赞</author><pubDate>Wed, 28 May 2008 02:33:00 GMT</pubDate><guid>//www.ot7t.com.cn/vip01/archive/2008/05/28/128075.html</guid><wfw:comment>//www.ot7t.com.cn/vip01/comments/128075.html</wfw:comment><comments>//www.ot7t.com.cn/vip01/archive/2008/05/28/128075.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>//www.ot7t.com.cn/vip01/comments/commentRss/128075.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/vip01/services/trackbacks/128075.html</trackback:ping><description><![CDATA[     摘要: 这是一篇很久前写了一半的文章。后来太忙就搁置了,今天终于补完了?nbsp; <a href='//www.ot7t.com.cn/vip01/archive/2008/05/28/128075.html'>阅读全文</a><img src ="//www.ot7t.com.cn/vip01/aggbug/128075.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/vip01/" target="_blank">交口称赞</a> 2008-05-28 10:33 <a href="//www.ot7t.com.cn/vip01/archive/2008/05/28/128075.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>史上最简洁的XML2BEAN和BEAN2XML - 四川福利彩票快乐12快乐12开奖直播快乐12开奖辽宁福彩快乐12快乐彩12选5走势图//www.ot7t.com.cn/vip01/archive/2008/05/21/201822.html交口称赞交口称赞Wed, 21 May 2008 01:30:00 GMT//www.ot7t.com.cn/vip01/archive/2008/05/21/201822.html//www.ot7t.com.cn/vip01/comments/201822.html//www.ot7t.com.cn/vip01/archive/2008/05/21/201822.html#Feedback0//www.ot7t.com.cn/vip01/comments/commentRss/201822.html//www.ot7t.com.cn/vip01/services/trackbacks/201822.html 引入xstream?br />
 

XML2Bean

XStream xStreamt 
=   new  XStream( new  DomDriver());

xStreamt.alias(
" config " , ConnectConfig. class ); // 指定节点对应的class

ConnectConfig cfgt 
=  (ConnectConfig) xStreamt.fromXML(str); // str是接收到的xml字符串,注意,xml里面的节点和bean的属性一定要能对应上,否则会抛异?/span>

System.out.println(cfgt.getAdminEmail());

 

 

 

Bean2XML

XStream xStream 
=   new  XStream( new  DomDriver());

xStream.alias(
" config " , ConnectConfig. class ); // 指定class对应的节点名称,默认是完整package名称+class名称

String str 
=  xStream.toXML(cfg); // str为生成的xml,值为空的属性不生成节点?/span>

System.out.println(str);



交口称赞 2008-05-21 09:30 发表评论
]]>
LOG4J输出日志到web目录的相对路?/title><link>//www.ot7t.com.cn/vip01/archive/2008/05/21/201821.html</link><dc:creator>交口称赞</dc:creator><author>交口称赞</author><pubDate>Wed, 21 May 2008 01:29:00 GMT</pubDate><guid>//www.ot7t.com.cn/vip01/archive/2008/05/21/201821.html</guid><wfw:comment>//www.ot7t.com.cn/vip01/comments/201821.html</wfw:comment><comments>//www.ot7t.com.cn/vip01/archive/2008/05/21/201821.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>//www.ot7t.com.cn/vip01/comments/commentRss/201821.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/vip01/services/trackbacks/201821.html</trackback:ping><description><![CDATA[项目中必须是在使用spring<br />web.xml加入<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">context-param</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />  </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">param-name</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">webAppRootKey</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">param-name</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />  </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">param-value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">webApp.root</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">param-value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /> </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">context-param</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><br />  </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">context-param</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />  </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">param-name</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">log4jConfigLocation</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">param-name</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />  </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">param-value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">/WEB-INF/classes/log/log4j.properties</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">param-value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /> </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">context-param</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br /><br />   </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">context-param</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />      </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">param-name</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">log4jRefreshInterval</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">param-name</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />      </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">param-value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">600000</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">param-value</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />   </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">context-param</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000">  <br />    </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">listener</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />      </span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">listener-class</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />        org.springframework.web.util.Log4jConfigListener<br />      </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">listener-class</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />   </span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">listener</span><span style="COLOR: #0000ff">></span></div><br /><br />然后log4j.properties里面指定文件路径的时候就可以?{webApp.root}/<br />log4j.appender.info.File=${webApp.root}/WEB-INF/logs/info.log<br />同时你的web项目必须?WEB-INF/logs这个目录<img src ="//www.ot7t.com.cn/vip01/aggbug/201821.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/vip01/" target="_blank">交口称赞</a> 2008-05-21 09:29 <a href="//www.ot7t.com.cn/vip01/archive/2008/05/21/201821.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Log4j按级别输出日志到不同的文?/title><link>//www.ot7t.com.cn/vip01/archive/2008/05/21/201819.html</link><dc:creator>交口称赞</dc:creator><author>交口称赞</author><pubDate>Wed, 21 May 2008 01:26:00 GMT</pubDate><guid>//www.ot7t.com.cn/vip01/archive/2008/05/21/201819.html</guid><wfw:comment>//www.ot7t.com.cn/vip01/comments/201819.html</wfw:comment><comments>//www.ot7t.com.cn/vip01/archive/2008/05/21/201819.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>//www.ot7t.com.cn/vip01/comments/commentRss/201819.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/vip01/services/trackbacks/201819.html</trackback:ping><description><![CDATA[ <p>会按日存分割日志文件,并且根据级别输出到不同的文?/p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <span style="COLOR: #000000">log4j.rootLogger=info,stdout,info,debug,error<br />log4j.appender.stdout=org.apache.log4j.ConsoleAppender<br />log4j.appender.stdout.layout=org.apache.log4j.PatternLayout<br />log4j.appender.stdout.layout.ConversionPattern=[%-5p] [%d{HH:mm:ss}] %c - %m%n<br /> <br />log4j.logger.info=info<br />log4j.appender.info=org.apache.log4j.DailyRollingFileAppender<br />log4j.appender.info.layout=org.apache.log4j.PatternLayout<br />log4j.appender.info.layout.ConversionPattern=[%-5p] [%d{HH:mm:ss}] %c - %m%n<br />log4j.appender.info.datePattern='.'yyyy-MM-dd<br />log4j.appender.info.Threshold = INFO <br />log4j.appender.info.append=true<br />log4j.appender.info.File=${webApp.root}/WEB-INF/logs/info.log<br /> <br />log4j.logger.debug=debug<br />log4j.appender.debug=org.apache.log4j.DailyRollingFileAppender<br />log4j.appender.debug.layout=org.apache.log4j.PatternLayout<br />log4j.appender.debug.layout.ConversionPattern=[%-5p] [%d{HH:mm:ss}] %c - %m%n<br />log4j.appender.debug.datePattern='.'yyyy-MM-dd<br />log4j.appender.debug.Threshold = DEBUG <br />log4j.appender.debug.append=true<br />log4j.appender.debug.File=${webApp.root}/WEB-INF/logs/debug.log<br /><br />log4j.logger.error=error<br />log4j.appender.error=org.apache.log4j.DailyRollingFileAppender<br />log4j.appender.error.layout=org.apache.log4j.PatternLayout<br />log4j.appender.error.layout.ConversionPattern=[%-5p] [%d{HH:mm:ss}] %c - %m%n<br />log4j.appender.error.datePattern='.'yyyy-MM-dd<br />log4j.appender.error.Threshold = ERROR <br />log4j.appender.error.append=true<br />log4j.appender.error.File=${webApp.root}/WEB-INF/logs/error.log</span> </div> <img src ="//www.ot7t.com.cn/vip01/aggbug/201819.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/vip01/" target="_blank">交口称赞</a> 2008-05-21 09:26 <a href="//www.ot7t.com.cn/vip01/archive/2008/05/21/201819.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>KMPLAYER的超简洁vista风格皮肤开放下?/title><link>//www.ot7t.com.cn/vip01/archive/2008/05/07/198858.html</link><dc:creator>交口称赞</dc:creator><author>交口称赞</author><pubDate>Wed, 07 May 2008 01:33:00 GMT</pubDate><guid>//www.ot7t.com.cn/vip01/archive/2008/05/07/198858.html</guid><wfw:comment>//www.ot7t.com.cn/vip01/comments/198858.html</wfw:comment><comments>//www.ot7t.com.cn/vip01/archive/2008/05/07/198858.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>//www.ot7t.com.cn/vip01/comments/commentRss/198858.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/vip01/services/trackbacks/198858.html</trackback:ping><description><![CDATA[     摘要: 开放下?nbsp; <a href='//www.ot7t.com.cn/vip01/archive/2008/05/07/198858.html'>阅读全文</a><img src ="//www.ot7t.com.cn/vip01/aggbug/198858.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/vip01/" target="_blank">交口称赞</a> 2008-05-07 09:33 <a href="//www.ot7t.com.cn/vip01/archive/2008/05/07/198858.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>flex3 控件转图?/title><link>//www.ot7t.com.cn/vip01/archive/2008/01/14/175100.html</link><dc:creator>交口称赞</dc:creator><author>交口称赞</author><pubDate>Mon, 14 Jan 2008 02:46:00 GMT</pubDate><guid>//www.ot7t.com.cn/vip01/archive/2008/01/14/175100.html</guid><wfw:comment>//www.ot7t.com.cn/vip01/comments/175100.html</wfw:comment><comments>//www.ot7t.com.cn/vip01/archive/2008/01/14/175100.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>//www.ot7t.com.cn/vip01/comments/commentRss/175100.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/vip01/services/trackbacks/175100.html</trackback:ping><description><![CDATA[ <p>    var sceneHolder:UIComponent  = new UIComponent();<br />    this.addChildAt(sceneHolder, 0);<br />    var snapShotBMD:BitmapData=ImageSnapshot.captureBitmapData(myLabel);<br />    var myBitmap:Bitmap = new Bitmap(snapShotBMD);</p> <p>    sceneHolder.addChild(myBitmap);<br /><br />  <mx:Label id="myLabel" x="187" y="86" text="Hermit" visible="false"/><br /><br /></p> <img src ="//www.ot7t.com.cn/vip01/aggbug/175100.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.ot7t.com.cn/vip01/" target="_blank">交口称赞</a> 2008-01-14 10:46 <a href="//www.ot7t.com.cn/vip01/archive/2008/01/14/175100.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用flex的成?/title><link>//www.ot7t.com.cn/vip01/archive/2008/01/08/173550.html</link><dc:creator>交口称赞</dc:creator><author>交口称赞</author><pubDate>Tue, 08 Jan 2008 02:26:00 GMT</pubDate><guid>//www.ot7t.com.cn/vip01/archive/2008/01/08/173550.html</guid><wfw:comment>//www.ot7t.com.cn/vip01/comments/173550.html</wfw:comment><comments>//www.ot7t.com.cn/vip01/archive/2008/01/08/173550.html#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>//www.ot7t.com.cn/vip01/comments/commentRss/173550.html</wfw:commentRss><trackback:ping>//www.ot7t.com.cn/vip01/services/trackbacks/173550.html</trackback:ping><description><![CDATA[     摘要: 应网友留言聊聊使用flex的成?欢迎补充  <a href='//www.ot7t.com.cn/vip01/archive/2008/01/08/173550.html'>阅读全文</a><img src ="//www.ot7t.com.cn/vip01/aggbug/173550.html" width = "1" height = "1" /><br><br><div align=right><a href="//www.ot7t.com.cn/" title="四川福利彩票快乐12">四川福利彩票快乐12</a> 2008-01-08 10:26 <a href="//www.ot7t.com.cn/vip01/archive/2008/01/08/173550.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <script>(function(){ var src = (document.location.protocol == "http:") ? "//js.passport.qihucdn.com/11.0.1.js?f7a6bc378844a5df707c414e6b6fea33":"https://jspassport.ssl.qhimg.com/11.0.1.js?f7a6bc378844a5df707c414e6b6fea33"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script>