??xml version="1.0" encoding="utf-8" standalone="yes"?>云南11选5计划对世界http://www.cxosbg.tw/vip01/用优雅的设计解决丑陋的问?/description>zh-cnTue, 02 Jul 2019 21:20:20 GMTTue, 02 Jul 2019 21:20:20 GMT60原创技巧解决list做strtus2标签checkboxlist默认值无法选中的问?/title><link>http://www.cxosbg.tw/vip01/archive/2010/12/02/339602.html</link><dc:creator>交口U赞</dc:creator><author>交口U赞</author><pubDate>Thu, 02 Dec 2010 06:09:00 GMT</pubDate><guid>http://www.cxosbg.tw/vip01/archive/2010/12/02/339602.html</guid><wfw:comment>http://www.cxosbg.tw/vip01/comments/339602.html</wfw:comment><comments>http://www.cxosbg.tw/vip01/archive/2010/12/02/339602.html#Feedback</comments><slash:comments>5</slash:comments><wfw:commentRss>http://www.cxosbg.tw/vip01/comments/commentRss/339602.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/vip01/services/trackbacks/339602.html</trackback:ping><description><![CDATA[<span style="font-family: Tahoma; font-size: 12px; line-height: 18px; ">用struts2的标{checkboxlist可以很方便的用生成checkboxl?但是让其默认选中指定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; ">之前?U方?</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; ">W一U是修改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; ">比如http://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; ">W二U就是彻底妥?在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; ">q两Usolution都不是那么优?作ؓ一个有房贷没希望的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; ">L?研究了下ognl的语?l于让我扑ֈ了一U方便的写法.</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, q且用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; ">q且当页面提交的时?又能自动把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; ">q样从后到前到再到后,全都是用list beand?用法l一,不要转换,全部操作的是bean而不是数l?</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; ">q个ognl表达?自动生成[4, 11]q种格式的数l?</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}来做qo,看着有点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; ">有同志会?q种qo没有什么意?不如在后台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,Ҏ前一个页面来qo男女,然后昄.</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; ">q时候这个过滤表辑ּ发挥作用了,不用您在后台一个一个过滤重新组装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; ">z而优?q下能过自己q关?</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 ="http://www.cxosbg.tw/vip01/aggbug/339602.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/vip01/" target="_blank">交口U赞</a> 2010-12-02 14:09 <a href="http://www.cxosbg.tw/vip01/archive/2010/12/02/339602.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ColdFusion实用技?/title><link>http://www.cxosbg.tw/vip01/archive/2008/10/29/237391.html</link><dc:creator>交口U赞</dc:creator><author>交口U赞</author><pubDate>Wed, 29 Oct 2008 07:49:00 GMT</pubDate><guid>http://www.cxosbg.tw/vip01/archive/2008/10/29/237391.html</guid><wfw:comment>http://www.cxosbg.tw/vip01/comments/237391.html</wfw:comment><comments>http://www.cxosbg.tw/vip01/archive/2008/10/29/237391.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cxosbg.tw/vip01/comments/commentRss/237391.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/vip01/services/trackbacks/237391.html</trackback:ping><description><![CDATA[最q做了一个ColdFusion的项目,收益颇多?br /><br />其中也碰C一些bt的需求,l合目把一些小技巧和大家分n一下(一? ColdFusionl验的菜鸟被赉子上架的搞了几天心得Q如果你认ؓ单的可笑Ƣ迎指教Qؕ喷党L行)<br /><br />先来点小?br /><br /><ul><li>ColdFusion使用ajaxQColdFusionq回json格式的数据)</li></ul>用惯了jqueryQ直接无视ColdFusion的ajax。既然用jqueryQ当然希望后台返回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>http://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#));q句会把查询l果</span><span style="color: rgb(0, 0, 0);">tableSum序列化成json格式传给前台?br /><br /></span><ul><li>ColdFusion不自动{义参?/li></ul>PreserveSingleQuotes(name)QColdFusionZ安全,会自动{义参C的特D字W。特D情况下我们不希望他q样做,可以用上面的方法?br /><br /><ul><li>ColdFusion字符串比较,以XXl尾</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><li>取整<span style="color: rgb(0, 0, 255);"> NumberFormat</span></li></ul><br /><ul><li><span style="color: rgb(0, 0, 255);"></span>取list长度 listLen</li></ul><br /><ul><li>取listW几个ListGetAt</li></ul><br /><ul><li>查询l果字段列表 query.columnlis </li></ul><br /><ul><li>查询l果集某个字D늚W几?query.columnname[i]#<br /></li></ul><br />以上只是Z再来一个大菜:动态列Q表根{以下是化的代码<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, 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只能Ҏ一个变量名U取取查询结果的字段Q没有根据位|或者字W串取,非常不爽?br /><br />核心是?span style="color: rgb(0, 0, 255);">EvaluateҎ一个字W串d态构造一个变量,</span>然后Ҏq个变量取出query中的列?br />个这个字W串可以从一个list里面动态@环取出来再拼凑而成<br />而这个list可以从一些地Ҏ询或者传递过来?br />所以表格就动态了h?br /><br /><br /><br /><br /><br /><img src ="http://www.cxosbg.tw/vip01/aggbug/237391.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/vip01/" target="_blank">交口U赞</a> 2008-10-29 15:49 <a href="http://www.cxosbg.tw/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 Securityhttp://www.cxosbg.tw/vip01/archive/2008/06/02/205294.html交口U赞交口U赞Mon, 02 Jun 2008 04:09:00 GMThttp://www.cxosbg.tw/vip01/archive/2008/06/02/205294.htmlhttp://www.cxosbg.tw/vip01/comments/205294.htmlhttp://www.cxosbg.tw/vip01/archive/2008/06/02/205294.html#Feedback2http://www.cxosbg.tw/vip01/comments/commentRss/205294.htmlhttp://www.cxosbg.tw/vip01/services/trackbacks/205294.html阅读全文

交口U赞 2008-06-02 12:09 发表评论
]]>
学习Java6(一) WebServices (7)传递集合对象终极解x?/title><link>http://www.cxosbg.tw/vip01/archive/2008/05/28/128075.html</link><dc:creator>交口U赞</dc:creator><author>交口U赞</author><pubDate>Wed, 28 May 2008 02:33:00 GMT</pubDate><guid>http://www.cxosbg.tw/vip01/archive/2008/05/28/128075.html</guid><wfw:comment>http://www.cxosbg.tw/vip01/comments/128075.html</wfw:comment><comments>http://www.cxosbg.tw/vip01/archive/2008/05/28/128075.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cxosbg.tw/vip01/comments/commentRss/128075.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/vip01/services/trackbacks/128075.html</trackback:ping><description><![CDATA[     摘要: q是一很久前写了一半的文章。后来太忙就搁置了,今天l于补完了?nbsp; <a href='http://www.cxosbg.tw/vip01/archive/2008/05/28/128075.html'>阅读全文</a><img src ="http://www.cxosbg.tw/vip01/aggbug/128075.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/vip01/" target="_blank">交口U赞</a> 2008-05-28 10:33 <a href="http://www.cxosbg.tw/vip01/archive/2008/05/28/128075.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>史上最z的XML2BEAN和BEAN2XMLhttp://www.cxosbg.tw/vip01/archive/2008/05/21/201822.html交口U赞交口U赞Wed, 21 May 2008 01:30:00 GMThttp://www.cxosbg.tw/vip01/archive/2008/05/21/201822.htmlhttp://www.cxosbg.tw/vip01/comments/201822.htmlhttp://www.cxosbg.tw/vip01/archive/2008/05/21/201822.html#Feedback0http://www.cxosbg.tw/vip01/comments/commentRss/201822.htmlhttp://www.cxosbg.tw/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字符Ԍ注意Qxml里面的节点和bean的属性一定要能对应上Q否则会抛异?/span>

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

 

 

 

Bean2XML

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

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

String str 
=  xStream.toXML(cfg); // str为生成的xmlQgؓI的属性不生成节点?/span>

System.out.println(str);



交口U赞 2008-05-21 09:30 发表评论
]]>
LOG4J输出日志到web目录的相对\?/title><link>http://www.cxosbg.tw/vip01/archive/2008/05/21/201821.html</link><dc:creator>交口U赞</dc:creator><author>交口U赞</author><pubDate>Wed, 21 May 2008 01:29:00 GMT</pubDate><guid>http://www.cxosbg.tw/vip01/archive/2008/05/21/201821.html</guid><wfw:comment>http://www.cxosbg.tw/vip01/comments/201821.html</wfw:comment><comments>http://www.cxosbg.tw/vip01/archive/2008/05/21/201821.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.cxosbg.tw/vip01/comments/commentRss/201821.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/vip01/services/trackbacks/201821.html</trackback:ping><description><![CDATA[目中必L在用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里面指定文g路径的时候就可以?{webApp.root}/<br />log4j.appender.info.File=${webApp.root}/WEB-INF/logs/info.log<br />同时你的web目必须?WEB-INF/logsq个目录<img src ="http://www.cxosbg.tw/vip01/aggbug/201821.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/vip01/" target="_blank">交口U赞</a> 2008-05-21 09:29 <a href="http://www.cxosbg.tw/vip01/archive/2008/05/21/201821.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Log4j按别输出日志到不同的文?/title><link>http://www.cxosbg.tw/vip01/archive/2008/05/21/201819.html</link><dc:creator>交口U赞</dc:creator><author>交口U赞</author><pubDate>Wed, 21 May 2008 01:26:00 GMT</pubDate><guid>http://www.cxosbg.tw/vip01/archive/2008/05/21/201819.html</guid><wfw:comment>http://www.cxosbg.tw/vip01/comments/201819.html</wfw:comment><comments>http://www.cxosbg.tw/vip01/archive/2008/05/21/201819.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cxosbg.tw/vip01/comments/commentRss/201819.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/vip01/services/trackbacks/201819.html</trackback:ping><description><![CDATA[ <p>会按日存分割日志文gQƈ且根据别输出到不同的文?/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 ="http://www.cxosbg.tw/vip01/aggbug/201819.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/vip01/" target="_blank">交口U赞</a> 2008-05-21 09:26 <a href="http://www.cxosbg.tw/vip01/archive/2008/05/21/201819.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>KMPLAYER的超zvista风格皮肤开放下?/title><link>http://www.cxosbg.tw/vip01/archive/2008/05/07/198858.html</link><dc:creator>交口U赞</dc:creator><author>交口U赞</author><pubDate>Wed, 07 May 2008 01:33:00 GMT</pubDate><guid>http://www.cxosbg.tw/vip01/archive/2008/05/07/198858.html</guid><wfw:comment>http://www.cxosbg.tw/vip01/comments/198858.html</wfw:comment><comments>http://www.cxosbg.tw/vip01/archive/2008/05/07/198858.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cxosbg.tw/vip01/comments/commentRss/198858.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/vip01/services/trackbacks/198858.html</trackback:ping><description><![CDATA[     摘要: 开放下?nbsp; <a href='http://www.cxosbg.tw/vip01/archive/2008/05/07/198858.html'>阅读全文</a><img src ="http://www.cxosbg.tw/vip01/aggbug/198858.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/vip01/" target="_blank">交口U赞</a> 2008-05-07 09:33 <a href="http://www.cxosbg.tw/vip01/archive/2008/05/07/198858.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>flex3 控g转图?/title><link>http://www.cxosbg.tw/vip01/archive/2008/01/14/175100.html</link><dc:creator>交口U赞</dc:creator><author>交口U赞</author><pubDate>Mon, 14 Jan 2008 02:46:00 GMT</pubDate><guid>http://www.cxosbg.tw/vip01/archive/2008/01/14/175100.html</guid><wfw:comment>http://www.cxosbg.tw/vip01/comments/175100.html</wfw:comment><comments>http://www.cxosbg.tw/vip01/archive/2008/01/14/175100.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cxosbg.tw/vip01/comments/commentRss/175100.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/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 ="http://www.cxosbg.tw/vip01/aggbug/175100.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/vip01/" target="_blank">交口U赞</a> 2008-01-14 10:46 <a href="http://www.cxosbg.tw/vip01/archive/2008/01/14/175100.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用flex的成?/title><link>http://www.cxosbg.tw/vip01/archive/2008/01/08/173550.html</link><dc:creator>交口U赞</dc:creator><author>交口U赞</author><pubDate>Tue, 08 Jan 2008 02:26:00 GMT</pubDate><guid>http://www.cxosbg.tw/vip01/archive/2008/01/08/173550.html</guid><wfw:comment>http://www.cxosbg.tw/vip01/comments/173550.html</wfw:comment><comments>http://www.cxosbg.tw/vip01/archive/2008/01/08/173550.html#Feedback</comments><slash:comments>9</slash:comments><wfw:commentRss>http://www.cxosbg.tw/vip01/comments/commentRss/173550.html</wfw:commentRss><trackback:ping>http://www.cxosbg.tw/vip01/services/trackbacks/173550.html</trackback:ping><description><![CDATA[     摘要: 应网友留a聊聊使用flex的成?Ƣ迎补充  <a href='http://www.cxosbg.tw/vip01/archive/2008/01/08/173550.html'>阅读全文</a><img src ="http://www.cxosbg.tw/vip01/aggbug/173550.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cxosbg.tw/vip01/" target="_blank">交口U赞</a> 2008-01-08 10:26 <a href="http://www.cxosbg.tw/vip01/archive/2008/01/08/173550.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <a href="http://www.cxosbg.tw/"><span class="STYLE1">11ѡ5</span></a> <script>(function(){ var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?9ed1f3a8f9c3ff069b7b95c01474c743":"https://jspassport.ssl.qhimg.com/11.0.1.js?9ed1f3a8f9c3ff069b7b95c01474c743"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script> <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>