??xml version="1.0" encoding="utf-8" standalone="yes"?>国产日产亚洲系列,亚洲日韩在线第一页,亚洲香蕉在线观看http://www.tkk7.com/piliskys/zh-cnSat, 10 May 2025 00:16:37 GMTSat, 10 May 2025 00:16:37 GMT60oracle中substr的问?http://www.tkk7.com/piliskys/archive/2006/09/20/70831.html霚w?/dc:creator>霚w?/author>Wed, 20 Sep 2006 08:20:00 GMThttp://www.tkk7.com/piliskys/archive/2006/09/20/70831.htmlhttp://www.tkk7.com/piliskys/comments/70831.htmlhttp://www.tkk7.com/piliskys/archive/2006/09/20/70831.html#Feedback0http://www.tkk7.com/piliskys/comments/commentRss/70831.htmlhttp://www.tkk7.com/piliskys/services/trackbacks/70831.htmlSELECT a.TAXPAYERID TAXPAYERID$0, a.INDEPOTYEAR INDEPOTYEAR$2
SUM(a.TAXFINAL) SUMTAXFINAL$1 
FROM F_LVY_LEVYINPUTYEARHISTORYDATA a 
WHERE substr ( a.TAXPAYERID ,1 , 1 ) 'T' and a.indepotyear='2006' GROUP BY a.TAXPAYERID, a.INDEPOTYEAR having SUM(a.TAXFINAL) >=1000000 W一ơ运行?357条记录,然后接着q行变?359Q此为正数Q,到网上找了下Q没有找到原因, 最后把substr ( a.TAXPAYERID ,1 , 1 ) 'T' 改ؓ a.TAXPAYERID not like 'T%'没有问题Q把上面sql改ؓ
SELECT a.TAXPAYERID TAXPAYERID$0, a.INDEPOTYEAR INDEPOTYEAR$2SUM(a.TAXFINAL) SUMTAXFINAL$1 FROM F_LVY_LEVYINPUTYEARHISTORYDATA a WHERE a.indepotyear='2006' GROUP BY a.TAXPAYERID, a.INDEPOTYEAR having SUM(a.TAXFINAL) >=1000000 and substr ( a.TAXPAYERID ,1 , 1 ) 'T' 
也没有问题, 而所有记录中substr ( a.TAXPAYERID ,1 , 1 )只有三种0,1,T, a.TAXPAYERID没有为空的,不清楚ؓ何如此?Q?

]]>
SQL角本-建物化视?/title><link>http://www.tkk7.com/piliskys/archive/2006/09/07/68322.html</link><dc:creator>霚w?/dc:creator><author>霚w?/author><pubDate>Thu, 07 Sep 2006 09:13:00 GMT</pubDate><guid>http://www.tkk7.com/piliskys/archive/2006/09/07/68322.html</guid><wfw:comment>http://www.tkk7.com/piliskys/comments/68322.html</wfw:comment><comments>http://www.tkk7.com/piliskys/archive/2006/09/07/68322.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/piliskys/comments/commentRss/68322.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/piliskys/services/trackbacks/68322.html</trackback:ping><description><![CDATA[ <p>目的Q对某表创徏物化视图Ӟ不要求它所有字D,因此必须列出要的字段Q一个个字段COPY也比较麻?因此写一角本<br /></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"> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #0000ff">select</span> <span style="COLOR: #000000"> <br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #ff0000">create  materialized view </span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #808080">||</span> <span style="COLOR: #ff00ff">max</span> <span style="COLOR: #000000">(a.table_name)</span> <span style="COLOR: #808080">||</span> <span style="COLOR: #000000">chr(</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">10</span> <span style="COLOR: #000000">)</span> <span style="COLOR: #808080">||</span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />   </span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #ff0000">tablespace staging refresh fast  as select</span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #808080">||</span> <span style="COLOR: #000000">chr(</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">10</span> <span style="COLOR: #000000">)</span> <span style="COLOR: #808080">||</span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> substr(</span> <span style="COLOR: #ff00ff">max</span> <span style="COLOR: #000000">(sys_connect_by_path(a.column_name</span> <span style="COLOR: #808080">||</span> <span style="COLOR: #000000">chr(</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">10</span> <span style="COLOR: #000000">),</span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #ff0000">,</span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #000000">)),</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">2</span> <span style="COLOR: #000000">)</span> <span style="COLOR: #808080">||</span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #ff0000">from </span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #808080">||</span> <span style="COLOR: #ff00ff">max</span> <span style="COLOR: #000000">(a.table_name)</span> <span style="COLOR: #808080">||</span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #ff0000">@zhengguan t;</span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #008080">--</span> <span style="COLOR: #008080">q里是DBLINK</span> <span style="COLOR: #008080"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000"> <br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />  </span> <span style="COLOR: #0000ff">from</span> <span style="COLOR: #000000"> <br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />( </span> <span style="COLOR: #0000ff">select</span> <span style="COLOR: #000000"> row_number() </span> <span style="COLOR: #0000ff">over</span> <span style="COLOR: #000000">( PARTITION </span> <span style="COLOR: #0000ff">BY</span> <span style="COLOR: #000000"> g.table_name  </span> <span style="COLOR: #0000ff">order</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">by</span> <span style="COLOR: #000000"> g.column_id  )  rn <br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    ,g.table_name,g.column_name  </span> <span style="COLOR: #0000ff">from</span> <span style="COLOR: #000000"> <br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />         user_tab_cols  g<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />          </span> <span style="COLOR: #0000ff">where</span> <span style="COLOR: #000000"> g.table_name </span> <span style="COLOR: #808080">=</span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #ff0000">TB_LVY_INCREASEDECREASEDATA</span> <span style="COLOR: #ff0000">'</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #008080">--</span> <span style="COLOR: #008080">q里是要建的表名</span> <span style="COLOR: #008080"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000">          ) a<br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />          <br /><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />           start </span> <span style="COLOR: #0000ff">with</span> <span style="COLOR: #000000"> rn</span> <span style="COLOR: #808080">=</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">1</span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />          connect </span> <span style="COLOR: #0000ff">by</span> <span style="COLOR: #000000">  rn </span> <span style="COLOR: #808080">=</span> <span style="COLOR: #000000">  prior rn </span> <span style="COLOR: #808080">+</span> <span style="FONT-WEIGHT: bold; COLOR: #800000">1</span> </div>q用Q对于一些存储过E中对表的insertӞq样也许可减些工作量,反正灉|q用吧,一个角本也讔R过自己的变化,在工作中可以启到一定的作用?img src ="http://www.tkk7.com/piliskys/aggbug/68322.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/piliskys/" target="_blank">霚w?/a> 2006-09-07 17:13 <a href="http://www.tkk7.com/piliskys/archive/2006/09/07/68322.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>struts的轻量架构(新手有用Q?/title><link>http://www.tkk7.com/piliskys/archive/2006/04/18/41568.html</link><dc:creator>霚w?/dc:creator><author>霚w?/author><pubDate>Tue, 18 Apr 2006 01:10:00 GMT</pubDate><guid>http://www.tkk7.com/piliskys/archive/2006/04/18/41568.html</guid><wfw:comment>http://www.tkk7.com/piliskys/comments/41568.html</wfw:comment><comments>http://www.tkk7.com/piliskys/archive/2006/04/18/41568.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.tkk7.com/piliskys/comments/commentRss/41568.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/piliskys/services/trackbacks/41568.html</trackback:ping><description><![CDATA[用过struts都清楚,struts的开发一般要写两个类QFormBean和Actionc,通常情况下Action是这LQ? <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"><img id="Codehighlighter1_41_355_Open_Image" onclick="this.style.display='none'; Codehighlighter1_41_355_Open_Text.style.display='none'; Codehighlighter1_41_355_Closed_Image.style.display='inline'; Codehighlighter1_41_355_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_41_355_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_41_355_Closed_Text.style.display='none'; Codehighlighter1_41_355_Open_Image.style.display='inline'; Codehighlighter1_41_355_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">   </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> XXXAction  </span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000"> Action </span><span id="Codehighlighter1_41_355_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_41_355_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> ActionForward execute(ActionMapping mapping, ActionForm form,<br /><img id="Codehighlighter1_224_354_Open_Image" onclick="this.style.display='none'; Codehighlighter1_224_354_Open_Text.style.display='none'; Codehighlighter1_224_354_Closed_Image.style.display='inline'; Codehighlighter1_224_354_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_224_354_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_224_354_Closed_Text.style.display='none'; Codehighlighter1_224_354_Open_Image.style.display='inline'; Codehighlighter1_224_354_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                                 HttpServletRequest request, HttpServletResponse response) </span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000"> Exception </span><span id="Codehighlighter1_224_354_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_224_354_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        XXXXForm theform </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(XXXXForm) form;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">form的强制{?br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">q里是你要处理的业务逻辑了?/span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> mapping.findForward(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">XXXX</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span></span></div>q是一个Action最的代码了,它没有处理Q何逻辑Q只是一个蟩转,FormBean的话Q只要承ActionFormQ代码到没有规定Q到Ӟ我们可能会想Q每个Action里面都必d上面那些代码Q烦啊,q有在每个FormBean里我们一般都会定义一些常用的属性,如eventQ根据event的|我们来决定一些逻辑的处理及面的蟩转,每次要写Q也烦啊?br />   好,烦的话,那我们要开始做点事情了Q首先,写一个formBean代码如下Q? <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"><img id="Codehighlighter1_40_207_Open_Image" onclick="this.style.display='none'; Codehighlighter1_40_207_Open_Text.style.display='none'; Codehighlighter1_40_207_Closed_Image.style.display='inline'; Codehighlighter1_40_207_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_40_207_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_40_207_Closed_Text.style.display='none'; Codehighlighter1_40_207_Open_Image.style.display='inline'; Codehighlighter1_40_207_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> XXXForm </span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000">  ActionForm</span><span id="Codehighlighter1_40_207_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_40_207_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000"> String event;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">事g?/span><span style="COLOR: #008000"><br /><img id="Codehighlighter1_102_130_Open_Image" onclick="this.style.display='none'; Codehighlighter1_102_130_Open_Text.style.display='none'; Codehighlighter1_102_130_Closed_Image.style.display='inline'; Codehighlighter1_102_130_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_102_130_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_102_130_Closed_Text.style.display='none'; Codehighlighter1_102_130_Open_Image.style.display='inline'; Codehighlighter1_102_130_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> String getEvent() </span><span id="Codehighlighter1_102_130_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_102_130_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> event;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_171_205_Open_Image" onclick="this.style.display='none'; Codehighlighter1_171_205_Open_Text.style.display='none'; Codehighlighter1_171_205_Closed_Image.style.display='inline'; Codehighlighter1_171_205_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_171_205_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_171_205_Closed_Text.style.display='none'; Codehighlighter1_171_205_Open_Image.style.display='inline'; Codehighlighter1_171_205_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> setEvent(String event) </span><span id="Codehighlighter1_171_205_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_171_205_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">.event </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> event;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div>我想q谁都应该清楚,然后我们再写frombeanӞ׃要extends  ActionForm,而是extends  XXXForm了,q样Q我们省了些代码Q我们再来看ActionQ也q样试试Q? <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"><img id="Codehighlighter1_48_475_Open_Image" onclick="this.style.display='none'; Codehighlighter1_48_475_Open_Text.style.display='none'; Codehighlighter1_48_475_Closed_Image.style.display='inline'; Codehighlighter1_48_475_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_48_475_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_48_475_Closed_Text.style.display='none'; Codehighlighter1_48_475_Open_Image.style.display='inline'; Codehighlighter1_48_475_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">abstract</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> XXXAction  </span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000"> Action </span><span id="Codehighlighter1_48_475_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_48_475_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> ActionForward execute(ActionMapping mapping, ActionForm form,<br /><img id="Codehighlighter1_227_329_Open_Image" onclick="this.style.display='none'; Codehighlighter1_227_329_Open_Text.style.display='none'; Codehighlighter1_227_329_Closed_Image.style.display='inline'; Codehighlighter1_227_329_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_227_329_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_227_329_Closed_Text.style.display='none'; Codehighlighter1_227_329_Open_Image.style.display='inline'; Codehighlighter1_227_329_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                             HttpServletRequest request, HttpServletResponse response) </span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000"> Exception </span><span id="Codehighlighter1_227_329_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_227_329_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        XXXForm theform </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(XXXForm) form;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> mapping.findForward(doAction(theform));<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_336_417_Open_Image" onclick="this.style.display='none'; Codehighlighter1_336_417_Open_Text.style.display='none'; Codehighlighter1_336_417_Closed_Image.style.display='inline'; Codehighlighter1_336_417_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_336_417_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_336_417_Closed_Text.style.display='none'; Codehighlighter1_336_417_Open_Image.style.display='inline'; Codehighlighter1_336_417_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />     </span><span id="Codehighlighter1_336_417_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/** */</span><span id="Codehighlighter1_336_417_Open_Text"><span style="COLOR: #008000">/**</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      * 处理一些业?br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      * </span><span style="COLOR: #808080">@param</span><span style="COLOR: #008000"> form<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      * </span><span style="COLOR: #808080">@return</span><span style="COLOR: #008000">    q回mapping指向的字W串<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />      </span><span style="COLOR: #008000">*/</span></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />   </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">abstract</span><span style="COLOR: #000000">  String doAction(BaseForm form);</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">抽象</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /></span><span style="COLOR: #000000">}</span></span></div>q样的话Q我们再写ActioncLQ就不extends Action而是extends XXXActionQ代码就像: <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"><img id="Codehighlighter1_41_200_Open_Image" onclick="this.style.display='none'; Codehighlighter1_41_200_Open_Text.style.display='none'; Codehighlighter1_41_200_Closed_Image.style.display='inline'; Codehighlighter1_41_200_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_41_200_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_41_200_Closed_Text.style.display='none'; Codehighlighter1_41_200_Open_Image.style.display='inline'; Codehighlighter1_41_200_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">***</span><span style="COLOR: #000000">Action </span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000"> XXXAction </span><span id="Codehighlighter1_41_200_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_41_200_Open_Text"><span style="COLOR: #000000">{<br /><img id="Codehighlighter1_84_198_Open_Image" onclick="this.style.display='none'; Codehighlighter1_84_198_Open_Text.style.display='none'; Codehighlighter1_84_198_Closed_Image.style.display='inline'; Codehighlighter1_84_198_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_84_198_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_84_198_Closed_Text.style.display='none'; Codehighlighter1_84_198_Open_Image.style.display='inline'; Codehighlighter1_84_198_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> String doAction(XXXForm form) </span><span id="Codehighlighter1_84_198_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_84_198_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #000000">***</span><span style="COLOR: #000000">Form theform </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> (</span><span style="COLOR: #000000">***</span><span style="COLOR: #000000">Form) form;</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">强制转成你真正的formbean<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">q里是你要处理的业务逻辑了  ?/span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">     </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> </span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">success</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div><p>是以上一些代码,单多了吧Qreturn一个字W串p了,感觉q有点像webwork?到此完了吗,有没</p><p>有什么还没有做呢Q对了,q样的话Q我们定义的Action都成无会话的bean了,所以request是要得到?/p><p>Q很多情况下的url?**action.do?id=cctv,而且一般是pȝ都是把用L信息攑օsession中的Q所?/p><p>request是强烈要求要q给我们的,好,那我们来重构下formbean和action吧,以下我们用BaseForm,?/p><p>BaseAction来定义,两个c都攑֜同一个包?/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"><img id="Codehighlighter1_41_704_Open_Image" onclick="this.style.display='none'; Codehighlighter1_41_704_Open_Text.style.display='none'; Codehighlighter1_41_704_Closed_Image.style.display='inline'; Codehighlighter1_41_704_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_41_704_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_41_704_Closed_Text.style.display='none'; Codehighlighter1_41_704_Open_Image.style.display='inline'; Codehighlighter1_41_704_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> BaseForm </span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000">  ActionForm</span><span id="Codehighlighter1_41_704_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_41_704_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000"> String event;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000"> HttpServletRequest request;<br /><img id="Codehighlighter1_113_222_Open_Image" onclick="this.style.display='none'; Codehighlighter1_113_222_Open_Text.style.display='none'; Codehighlighter1_113_222_Closed_Image.style.display='inline'; Codehighlighter1_113_222_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_113_222_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_113_222_Closed_Text.style.display='none'; Codehighlighter1_113_222_Open_Image.style.display='inline'; Codehighlighter1_113_222_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_113_222_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/** */</span><span id="Codehighlighter1_113_222_Open_Text"><span style="COLOR: #008000">/**</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      * 注:q个是得到用户信息,q个只是一个例子,也可不实玎ͼ由request得到sessionQ再得到<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />user,<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      * 但reguser字符串对一般开发h员可能是不可见的<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />      </span><span style="COLOR: #008000">*/</span></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_250_331_Open_Image" onclick="this.style.display='none'; Codehighlighter1_250_331_Open_Text.style.display='none'; Codehighlighter1_250_331_Closed_Image.style.display='inline'; Codehighlighter1_250_331_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_250_331_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_250_331_Closed_Text.style.display='none'; Codehighlighter1_250_331_Open_Image.style.display='inline'; Codehighlighter1_250_331_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> User getUser() </span><span id="Codehighlighter1_250_331_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_250_331_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">   (User) getRequest().getSession().getAttribute(</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">reguser</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_376_406_Open_Image" onclick="this.style.display='none'; Codehighlighter1_376_406_Open_Text.style.display='none'; Codehighlighter1_376_406_Closed_Image.style.display='inline'; Codehighlighter1_376_406_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_376_406_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_376_406_Closed_Text.style.display='none'; Codehighlighter1_376_406_Open_Image.style.display='inline'; Codehighlighter1_376_406_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> HttpServletRequest getRequest() </span><span id="Codehighlighter1_376_406_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_376_406_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> request;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_412_470_Open_Image" onclick="this.style.display='none'; Codehighlighter1_412_470_Open_Text.style.display='none'; Codehighlighter1_412_470_Closed_Image.style.display='inline'; Codehighlighter1_412_470_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_412_470_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_412_470_Closed_Text.style.display='none'; Codehighlighter1_412_470_Open_Image.style.display='inline'; Codehighlighter1_412_470_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_412_470_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/** */</span><span id="Codehighlighter1_412_470_Open_Text"><span style="COLOR: #008000">/**</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      * 注:q里用的protectedQ这样可以就同一包的cd调用Q其它类是不可见?br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />      </span><span style="COLOR: #008000">*/</span></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_530_568_Open_Image" onclick="this.style.display='none'; Codehighlighter1_530_568_Open_Text.style.display='none'; Codehighlighter1_530_568_Closed_Image.style.display='inline'; Codehighlighter1_530_568_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_530_568_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_530_568_Closed_Text.style.display='none'; Codehighlighter1_530_568_Open_Image.style.display='inline'; Codehighlighter1_530_568_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">protected</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> setRequest(HttpServletRequest request) </span><span id="Codehighlighter1_530_568_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_530_568_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">.request </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> request;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_599_627_Open_Image" onclick="this.style.display='none'; Codehighlighter1_599_627_Open_Text.style.display='none'; Codehighlighter1_599_627_Closed_Image.style.display='inline'; Codehighlighter1_599_627_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_599_627_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_599_627_Closed_Text.style.display='none'; Codehighlighter1_599_627_Open_Image.style.display='inline'; Codehighlighter1_599_627_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> String getEvent() </span><span id="Codehighlighter1_599_627_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_599_627_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> event;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_668_702_Open_Image" onclick="this.style.display='none'; Codehighlighter1_668_702_Open_Text.style.display='none'; Codehighlighter1_668_702_Closed_Image.style.display='inline'; Codehighlighter1_668_702_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_668_702_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_668_702_Closed_Text.style.display='none'; Codehighlighter1_668_702_Open_Image.style.display='inline'; Codehighlighter1_668_702_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> setEvent(String event) </span><span id="Codehighlighter1_668_702_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_668_702_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="COLOR: #0000ff">this</span><span style="COLOR: #000000">.event </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> event;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div>BaseAction代码Q?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"><img id="Codehighlighter1_49_523_Open_Image" onclick="this.style.display='none'; Codehighlighter1_49_523_Open_Text.style.display='none'; Codehighlighter1_49_523_Closed_Image.style.display='inline'; Codehighlighter1_49_523_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_49_523_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_49_523_Closed_Text.style.display='none'; Codehighlighter1_49_523_Open_Image.style.display='inline'; Codehighlighter1_49_523_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">abstract</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> BaseAction  </span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000"> Action </span><span id="Codehighlighter1_49_523_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_49_523_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> ActionForward execute(ActionMapping mapping, ActionForm form,<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                                 HttpServletRequest request, HttpServletResponse response) <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img id="Codehighlighter1_234_381_Open_Image" onclick="this.style.display='none'; Codehighlighter1_234_381_Open_Text.style.display='none'; Codehighlighter1_234_381_Closed_Image.style.display='inline'; Codehighlighter1_234_381_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_234_381_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_234_381_Closed_Text.style.display='none'; Codehighlighter1_234_381_Open_Image.style.display='inline'; Codehighlighter1_234_381_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span style="COLOR: #0000ff">throws</span><span style="COLOR: #000000"> Exception </span><span id="Codehighlighter1_234_381_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_234_381_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        BaseForm theform </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">(BaseForm) form;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        theform.setRequest(request);</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">加了q句</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">        </span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000"> mapping.findForward(doAction(theform));<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_388_469_Open_Image" onclick="this.style.display='none'; Codehighlighter1_388_469_Open_Text.style.display='none'; Codehighlighter1_388_469_Closed_Image.style.display='inline'; Codehighlighter1_388_469_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_388_469_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_388_469_Closed_Text.style.display='none'; Codehighlighter1_388_469_Open_Image.style.display='inline'; Codehighlighter1_388_469_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />     </span><span id="Codehighlighter1_388_469_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/** */</span><span id="Codehighlighter1_388_469_Open_Text"><span style="COLOR: #008000">/**</span><span style="COLOR: #008000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      * 处理一些业?br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      * </span><span style="COLOR: #808080">@param</span><span style="COLOR: #008000"> form<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />      * </span><span style="COLOR: #808080">@return</span><span style="COLOR: #008000">    q回mapping指向的字W串<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />      </span><span style="COLOR: #008000">*/</span></span><span style="COLOR: #000000"><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />   </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">abstract</span><span style="COLOR: #000000">  String doAction(BaseForm form);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div><p>到此ؓl束Q可能有Z问,那还有response呢,response的话Q一般出现在内部跌{{情况,感觉?/p><p>的比较少Q所以在此就不把它给大家了,如觉得一定要得到的话Q那prequest一栯行设|吧Q不q?/p><p>万事都应该有个度Q自p量?br /></p><img src ="http://www.tkk7.com/piliskys/aggbug/41568.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/piliskys/" target="_blank">霚w?/a> 2006-04-18 09:10 <a href="http://www.tkk7.com/piliskys/archive/2006/04/18/41568.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Jbdc助手-数据库操作面向对象的实现(oracle)http://www.tkk7.com/piliskys/archive/2006/03/29/38031.html霚w?/dc:creator>霚w?/author>Wed, 29 Mar 2006 05:43:00 GMThttp://www.tkk7.com/piliskys/archive/2006/03/29/38031.htmlhttp://www.tkk7.com/piliskys/comments/38031.htmlhttp://www.tkk7.com/piliskys/archive/2006/03/29/38031.html#Feedback8http://www.tkk7.com/piliskys/comments/commentRss/38031.htmlhttp://www.tkk7.com/piliskys/services/trackbacks/38031.html前言Q?br />如果你对hibernate不是那样的推崇,但感觉jdbc的sqlr操作又不是那么OO的话Q那么这文章可能给能带来或多或的期望?br />在很长的一D|间里Q中L觉应该对sql的操作来实现一U集成化Q这U想法可能是来源于hibernate操作的思维吧,当时头脑中有一些想法:
1Q 最大程度的让编E者对数据库操作实现面向对象操作,Q所有的一些基本操作,E序员可以不用去C表的字段名,完全对象化,如插|删|像hibernate一h出对多和对一的结果,把结果也对象化,一些不能实现的保留sql操作Q)
2Q 最大程度让sql语句重用Q提高数据库的效率(利用E序对一些操作sql的集成,保证相同操作sql的一致性)
3Q 操作要单,Ҏ与项目集成,通用Q约束少Q?br />对于当时Q头脑中只是有这些朦胧的定义Q而对于要实现何种ҎQ怎样把对对象操作来实现sql的拼接(q里是一个反的过E)Q心里没底,但能够实玎ͼ只是功能的强弱问题)q一点很清楚Q其实当时L考虑实现后是否有其h|是否对编E者有所帮助Q这个是我一直没有抽旉做的主要原因?br />正题Q?br />通过q几天的一些空余时_完成了q个东西Q不它是否有用Q只当是自己一ơ练习,现在把一些实现及调用的方法作个简介:
此工兯动生成两U文件vo与daoQ?br />值对象(VOQ,每一个表对应一个voQ?br />vo与普通的javabeanҎ相同Q有get和setҎQ若表A的主键作B的外键,那么此vo有get B表的一个listQto-manyQ?如果表A中引用了B 表的主键作ؓ外键Q那么它有get B 表的一个vo,Qto-oneQ?br />数据讉K对象QDAOQ,此文件对~程者是透明的,可以不作了解Q主要是一些访问数据的ҎQ由公用接口调用?br />首先在你的程序中调用接口的实?br />DataStore ds  =     com.piliskys.dataStore.DataManager.getInstance();
首先x此句q未得到数据库的联接Q而是当操作时才得到数据库联接的,而且在同一ơ会话中Q此联接是相同的Q具体可看ConnectionUtil此类Q此cd以对数务q行讄Q?br />在此接口中,没有定义提高和回滚操作,因ؓq些操作都可定义在开发框架中Q正常结束就提交Q捕获异常就回滚Q?br />q两操作可直接调ConnectionUtil.currentConnection("piliskys")的操作,
那么我们开始介l它的各个方法,在此Z个tb_person表ؓ例:
tb_person(per_name varchar2,per_age number), per_name Z?br />  1Q?public  boolean delete(Object obj)
  删除单个voQ需要设|主?
E序Q删一个叫 李 的记?br />DataStore ds  = com.piliskys.dataStore.DataManager.getInstance();//q里是没有跟数据?br />          ds.delete(new TbPerson("李"));//有主键的表都有此构造方?br />    ConnectionUtil.currentConnection("piliskys").commit;
----------------------------------------------
p么简?以下调用DataStore 和提交略

  2Q?public  int deleteByVO(Object obj)//q回删除的记录数
注:如果未对obj讄M条g不会进行删除操作(因ؓ个h认ؓq一般是不可能的Q比较危险,所以加以控Ӟ
E序Q删除姓  ?的记?br /> TbPerson tp =new TbPerson();
 tp.setPerName("?");
 ds.deleteByVO(tp);
----------------------------------------------
E序Q删除年龄大于等?19岁的记录
  TbPerson tp =new TbPerson();
 tp.setPerAge(new Long(19),">=");//所有双参数Ҏ都是Z些条仉择而用Q后面一参数是用来设操作W的 > < >= <= !=,q些Q方便吧
 ds.deleteByVO(tp);
----------------------------------------------
E序Q删除年龄ؓI的记录
  TbPerson tp =new TbPerson();
  tp.setPerAge(null);
  ds.deleteByVO(tp);
----------------------------------------------
  3  public  int update(Object obj)
  此操作必d主键q行讄Q否则报错,讄其它字段属于为更新字D,其它字段未设|也会报错,说明没有可更新的字段Q?br />E序 ?br />  4  public  int update(Object src,Object tar)//两对象必dc?代表同一?
   此操?以前一对象做ؓ条gq行扚w更新后一对象讄的?条g如是字符串可讄?Q条件对象也可加操作W,使用所有双参数讄都相同,其它可设|nullQ对''字符串不处理
E序 ?br />  5  public  boolean insert(Object obj)//未进行设|的字段为null
E序 插入一个叫 刘d?q龄?8的记?br />    TbPerson tp =new TbPerson();
    pt.setPerName("刘d?);
    pt.setPerAge(new Long(38));//age为Long型的?br />    ds.insert(pt);
----------------------------------------------
E序 插入一个叫 |拿?的,q龄未知
    TbPerson tp =new TbPerson();
    pt.setPerName("|拿?);
    ds.insert(pt);
----------------------------------------------
 6   public  List selectAll(Class class1)
q回所有记录(但此处ؓ考虑E序的效率,讄了一个最大数Q可参看原文件中定义的MAX_SIZE可进行更改,
E序 查出所有tb_person表的记录
     List list = ds.selectAll(TbPerson.class);//也简单吧
-----------------------------------------------
 7   public  void selectByPK(Object obj)
 Ҏ主键查找记录 Q这个是无返回值的Q返回的是本n的这个objQؓ了省点内存,不用多new一个对象,而且实现的话主键已经讑֥Q只要设其它字段Q而且个h认ؓq样更好用,如果一个表无主键,那么查出来的是数据库的W一条记录,利用 rownum=1实现Q而不是查出的W一条,最大程度地提高数据库的效率Q?br />E序  查出名叫 刘d华的记录
     TbPerson tp =new TbPerson("刘d?);
     ds.selectByPK(tp);
然后 q个tp是一个与数据库主键ؓ刘d华的记录Q可以用它了
-------------------------------------------------
 8  public  List selectByVO(Object obj)
此方法跟上面的deleteByVO的用基本相同,q回值是vo的一个系列,
有一点不同的是,deleteByVO不设|Q何查询条件将不会做操作,而此Ҏ不设|Q何条件的话就会查出所有的(个h认ؓ查询是无危害性的Q要查就查吧)
E序 参?deleteByVO
 9  public  List selectByVO(Object obj, int i, int j)
  此方法是上一Ҏ的扩充,主要是用于分|作,
E序 查姓 ?的第11条记录到20?br />        ds.selectByVO(new TbPerson("?"),11,20);//呵呵Q感觉这h点别?br />本应?TbPerson tp =new TbPerson();
                tp.setPerName("?");
         ds.selectByVO(tp,11,20);//效果一P
--------------------------------------------------
 10  public  int sqlExcute(String s, List list)
q个是用于直接调 sql语句的操作,主要是执行一些更斎ͼ删除操作Q?list是按条仉序设|的参数集,PreparedStatement的操?br />E序 ?br />  11  public List selectBySQL(String s, List list)
q个是用于直接调 sql语句的操作,执行查询操作Q?list是按条仉序设|的参数集,PreparedStatement的操?br />return  List 含map的list,key为字D全部小?br />E序 ?br /> 12  public  List selectByQuery(String s, List list)
q个是用于直接调 sql语句的操作,执行查询操作Q?list是按条仉序设|的参数集,PreparedStatement的操?br />return  List 含map的list,key为字D全部小?br />E序 ?br />  13  public  List selectByQuery(String s, List list,int i,int j)
同上Q但主要是ؓ了分|作,
        throws DAOException;

    public   void close()throws SQLException;
数据库联接关?br />关于事物提义及回滚请使用ConnectionUtil.currentConnection("piliskys")的操作?br />此程序支持在控制台显Csql语句Q可以在配制文g中设|是否显C,具体操作参看包中的说明?br />========================================================================
当然个h的能力是有限的,如果你认应该实现什么功能,E序哪方面不如h意,本h只是按照自己的观点,站在一个编E者的角度考虑问题Q不之处可能很多,希望多提见意和徏议,E序只是l本行测试,可能不是很全面,希望共同完善?br />关于如何部v于程序,包中有说明?br />注意事项Q不支持复合主键作ؓ其它表的外键,下次改进吧?/p>

最后:请尊重他人成果,谢谢您的支持Q本人邮?a href="mailto:piliskys@itpub.net">piliskys@itpub.net希望得到你的意见和徏议?br />========================================================================
此处下蝲原程?a href="/Files/piliskys/jdbcutil.rar">http://www.tkk7.com/Files/piliskys/jdbcutil.rar



]]>
数据库在java中占用过E杂?/title><link>http://www.tkk7.com/piliskys/archive/2006/03/21/36540.html</link><dc:creator>霚w?/dc:creator><author>霚w?/author><pubDate>Tue, 21 Mar 2006 00:45:00 GMT</pubDate><guid>http://www.tkk7.com/piliskys/archive/2006/03/21/36540.html</guid><wfw:comment>http://www.tkk7.com/piliskys/comments/36540.html</wfw:comment><comments>http://www.tkk7.com/piliskys/archive/2006/03/21/36540.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/piliskys/comments/commentRss/36540.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/piliskys/services/trackbacks/36540.html</trackback:ping><description><![CDATA[众所都知Q数据库事务及联接在java操作中是一个昂늚开销Q一些程序及效率的优化在q里有很大的优化I间Q但感觉数据库的开启关闭好像没有统一和最优的ҎQ?br /><img src="http://piliskys.itpub.net/get/8994/10235-1.JPG" /><br />如上?假设AF为java中一ơ会话的q程Q而bc和de表示java与数据库操作占用的过E(当然在会话中可能存在不止两次的数据库操作Q,现在可能有下面几U情况:<br />1),在A之前开启数据库及事务,在F之后提交或回滚事务和断开数据库(q可能在有些架构中是q样实现的,因ؓ作ؓE序员不用考虑数据库的联接关闭及事务,l一由公用类完成Q?br />2),在b之时开启在c之后断开Q在d之时又开启,在e之后断开Q这也很常见Q典型的用时开Q用完就断?br />3),在b之时开启,在F之后断开Q其实这U是跟第一U相同,只是一U改时Ş了,因ؓ我们可以定在一ơ会话中W一ơ用数据库,有h可能会说在e之后断开不是更好Q节省了efq程的数据库联接开销Q理Z是这LQ但是这是做不到的,因ؓ我们不知道用了这ơ数据库后在q次会话中就不会再用了,所以我们只能在f点结束后l一断开及处理事务?br />4),可能q有其它的方案是我不清楚的?br />因此Q我们可以看到在4Ҏ没有明确定义之前Q只??是可比较的,对于数据库占有的旉来看Q?Ҏ是肯定优?的,但是我们清楚数据库的开启及联接本n也是一个比较大的开销Q就像一个电视机Q多开些可能会费些电Q但如果L一开一关的话,电视ZҎ坏。如要有一个统一的{化参考标准:一ơ开销代表多少Q而占用的旉又代表多,那么我们肯定可以选出一个最优方案来Q但q看来是很难做到?看来软g的设计远没有U田来的实在?.<br />个h感觉应该采取W?U方案,因ؓ一些非数据库的处理多半是内存中的处理及q算Q应该很?但话是不能绝对的Qjava的一些文件处理及q程调用{可能也很慢)?br />如在数据库调用方面有何见解,望多探讨Q以上属个h愚见Q望能抛砖引玉?img src ="http://www.tkk7.com/piliskys/aggbug/36540.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/piliskys/" target="_blank">霚w?/a> 2006-03-21 08:45 <a href="http://www.tkk7.com/piliskys/archive/2006/03/21/36540.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>找蟩马最短\径的法http://www.tkk7.com/piliskys/archive/2006/03/20/36320.html霚w?/dc:creator>霚w?/author>Mon, 20 Mar 2006 06:36:00 GMThttp://www.tkk7.com/piliskys/archive/2006/03/20/36320.htmlhttp://www.tkk7.com/piliskys/comments/36320.htmlhttp://www.tkk7.com/piliskys/archive/2006/03/20/36320.html#Feedback0http://www.tkk7.com/piliskys/comments/commentRss/36320.htmlhttp://www.tkk7.com/piliskys/services/trackbacks/36320.html今天在网上看C个{找蟩马最短\径的法} Find shortest way of a Chinese chess horse that jump from (0, 0) to (m, n) in a grid area of m*n, and output the step number and way points. For example, in a grid area of (3 * 2), a horse can jump as (0, 0)->(1, 2)->(2, 0)->(3,2). And step number is 3. 感觉在一个m*n的矩阵中跌考虑边界问题Q在此用java写了一下,没有考虑边界Q以下程序只在无限二l中成立
代码如下

/**
 * 
@author  : <a href="piliskys@163.com">piliskys</a>
 * Date: 2006-2-22
 * Time: 13:50:56
 * 找蟩马最短\径的法
 * 
 
*/

public   class  HorsePro  {
    
public   static   void  main(String[] arg)  {
        HorsePosition start 
=   new  HorsePosition( 0 0 );
        HorsePosition end 
=   new  HorsePosition( 0 , 1 );
        
int  index = 0 ;
        
while  ( true {
               index
++ ;
            HorsePosition her 
=  getNext(start, end);
            
if  (her.positionX  ==   0   &&  her.positionY  ==   0 || index == 7 )
                
break ;
            start 
=   new  HorsePosition(start.positionX  +  her.positionX, start.positionY  +  her.positionY);
            System.out.println(
" W[ " + index + " ]?> " + start);
        }

    }

      
/**   */ /**
       * 以下为构造一个位|类
       
*/

    
static   class  HorsePosition  {
        HorsePosition(
int  a,  int  b)  {
            
this .positionX  =  a;
            
this .positionY  =  b;
        }

        
int  positionX;
        
int  positionY;
        
public  String toString()  {
            
return   " [ "   +   this .positionX  +   " , "   +   this .positionY  +   " ] " ;
        }

    }


    
public   static  HorsePosition getNext(HorsePosition a, HorsePosition b)  {
        
int  x, y, z;
        x 
=  b.positionX  -  a.positionX;
        y 
=  b.positionY  -  a.positionY;
        z 
=  Math.abs(x)  +  Math.abs(y);
        
if  (z  >=   3 {
            
if  (Math.abs(x)  >  Math.abs(y))  {
                
int  yy;
                
if  (y  ==   0 )  yy  =   1 ;
                
else
                    yy 
=  y  /  Math.abs(y);

                
return  ( new  HorsePosition( 2   *  x  /  Math.abs(x), yy));

            }
  else
            
{
                
int  xx;
                
if  (x  ==   0 )  xx  =   1 ;
                
else
                    xx 
=  x  /  Math.abs(x);
                
return  ( new  HorsePosition(xx,  2   *  y  /  Math.abs(y)));
            }

        }
  else
         
if  (z  ==   2 ) {

            
if (x == 0 ) {
                
return      new  HorsePosition( 2 ,y / 2  );
            }

            
if (y == 0 ) {
                
return      new  HorsePosition(x / 2 , 1  );
            }

          
if (x * y != 0 ) {
             
return      new  HorsePosition( 2 * x, - y );
          }

         }

         
else   if (z == 1 ) // 说明z==1的情况了
              if (x == 0 ) {
               
return       new  HorsePosition( 1 , 2 * y );
             }

             
else
        
return       new  HorsePosition( 2 * x, 1  );
         }


      
// 以下说明完成?/span>
        return    new    HorsePosition( 0 , 0  );

    }



}



]]>
数字转换成大写金?/title><link>http://www.tkk7.com/piliskys/archive/2006/03/20/36319.html</link><dc:creator>霚w?/dc:creator><author>霚w?/author><pubDate>Mon, 20 Mar 2006 06:34:00 GMT</pubDate><guid>http://www.tkk7.com/piliskys/archive/2006/03/20/36319.html</guid><wfw:comment>http://www.tkk7.com/piliskys/comments/36319.html</wfw:comment><comments>http://www.tkk7.com/piliskys/archive/2006/03/20/36319.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/piliskys/comments/commentRss/36319.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/piliskys/services/trackbacks/36319.html</trackback:ping><description><![CDATA[ <p>早此日子Q写了个数字转ؓ金额的,今天在电脑上扑ֈ的,虽然|上q类代码很多Q但毕竟׃些心思,所以在此记上,javascript实现的,代码如下Q?br /></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"> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">html</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">body</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">form</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">input type</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">text</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> value</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">1034354.245</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> name</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">text1</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">input type</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">button</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> value</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">out</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000"> onclick</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">piliskys()</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">/></span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">form</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">body</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">html</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">script</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_185_297_Open_Image" onclick="this.style.display='none'; Codehighlighter1_185_297_Open_Text.style.display='none'; Codehighlighter1_185_297_Closed_Image.style.display='inline'; Codehighlighter1_185_297_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_185_297_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_185_297_Closed_Text.style.display='none'; Codehighlighter1_185_297_Open_Image.style.display='inline'; Codehighlighter1_185_297_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">function</span> <span style="COLOR: #000000"> piliskys()</span> <span id="Codehighlighter1_185_297_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_185_297_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">var</span> <span style="COLOR: #000000"> test1</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> document.all.text1.value;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />       <br /><img id="Codehighlighter1_251_280_Open_Image" onclick="this.style.display='none'; Codehighlighter1_251_280_Open_Text.style.display='none'; Codehighlighter1_251_280_Closed_Image.style.display='inline'; Codehighlighter1_251_280_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_251_280_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_251_280_Closed_Text.style.display='none'; Codehighlighter1_251_280_Open_Image.style.display='inline'; Codehighlighter1_251_280_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">(isNaN(test1)) </span> <span id="Codehighlighter1_251_280_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_251_280_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />alert(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">不是一个有效的数字Q请重新输入Q?/span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">else</span> <span style="COLOR: #000000"> creat();<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> <br /> <img id="Codehighlighter1_316_699_Open_Image" onclick="this.style.display='none'; Codehighlighter1_316_699_Open_Text.style.display='none'; Codehighlighter1_316_699_Closed_Image.style.display='inline'; Codehighlighter1_316_699_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_316_699_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_316_699_Closed_Text.style.display='none'; Codehighlighter1_316_699_Open_Image.style.display='inline'; Codehighlighter1_316_699_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">function</span> <span style="COLOR: #000000"> creat()</span> <span id="Codehighlighter1_316_699_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_316_699_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">var</span> <span style="COLOR: #000000"> test1</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> document.all.text1.value;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">var</span> <span style="COLOR: #000000"> money1 </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">new</span> <span style="COLOR: #000000"> Number(test1);<br /><img id="Codehighlighter1_422_457_Open_Image" onclick="this.style.display='none'; Codehighlighter1_422_457_Open_Text.style.display='none'; Codehighlighter1_422_457_Closed_Image.style.display='inline'; Codehighlighter1_422_457_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_422_457_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_422_457_Closed_Text.style.display='none'; Codehighlighter1_422_457_Open_Image.style.display='inline'; Codehighlighter1_422_457_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">(money1</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">1000000000000000000</span> <span style="COLOR: #000000">) </span> <span id="Codehighlighter1_422_457_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_422_457_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />alert(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">你输入的数字太大Q重新输入!</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">var</span> <span style="COLOR: #000000"> monee  </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> Math.round(money1</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">100</span> <span style="COLOR: #000000">).toString(</span> <span style="COLOR: #000000">10</span> <span style="COLOR: #000000">)<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">var</span> <span style="COLOR: #000000"> i,j; <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    j</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span> <span style="COLOR: #0000ff">var</span> <span style="COLOR: #000000"> leng </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> monee.length;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">var</span> <span style="COLOR: #000000"> monval</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">""</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">for</span> <span style="COLOR: #000000">( i</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">;i</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">leng;i</span> <span style="COLOR: #000000">++</span> <span style="COLOR: #000000">)<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img id="Codehighlighter1_603_666_Open_Image" onclick="this.style.display='none'; Codehighlighter1_603_666_Open_Text.style.display='none'; Codehighlighter1_603_666_Closed_Image.style.display='inline'; Codehighlighter1_603_666_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_603_666_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_603_666_Closed_Text.style.display='none'; Codehighlighter1_603_666_Open_Image.style.display='inline'; Codehighlighter1_603_666_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> </span> <span id="Codehighlighter1_603_666_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_603_666_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> monval</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> monval</span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">to_upper(monee.charAt(i))</span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">to_mon(leng</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">i</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /> }</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> repace_acc(monval);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />         <br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">function</span> <span style="COLOR: #000000"> to_upper( a)<br /><img id="Codehighlighter1_725_1125_Open_Image" onclick="this.style.display='none'; Codehighlighter1_725_1125_Open_Text.style.display='none'; Codehighlighter1_725_1125_Closed_Image.style.display='inline'; Codehighlighter1_725_1125_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_725_1125_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_725_1125_Closed_Text.style.display='none'; Codehighlighter1_725_1125_Open_Image.style.display='inline'; Codehighlighter1_725_1125_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span id="Codehighlighter1_725_1125_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_725_1125_Open_Text"> <span style="COLOR: #000000">{<br /><img id="Codehighlighter1_737_1122_Open_Image" onclick="this.style.display='none'; Codehighlighter1_737_1122_Open_Text.style.display='none'; Codehighlighter1_737_1122_Closed_Image.style.display='inline'; Codehighlighter1_737_1122_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_737_1122_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_737_1122_Closed_Text.style.display='none'; Codehighlighter1_737_1122_Open_Image.style.display='inline'; Codehighlighter1_737_1122_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">switch</span> <span style="COLOR: #000000">(a)</span> <span id="Codehighlighter1_737_1122_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_737_1122_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> '</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">' : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> '</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">' : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> '</span> <span style="COLOR: #000000">2</span> <span style="COLOR: #000000">' : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> '</span> <span style="COLOR: #000000">3</span> <span style="COLOR: #000000">' : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> '</span> <span style="COLOR: #000000">4</span> <span style="COLOR: #000000">' : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> '</span> <span style="COLOR: #000000">5</span> <span style="COLOR: #000000">' : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> '</span> <span style="COLOR: #000000">6</span> <span style="COLOR: #000000">' : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> '</span> <span style="COLOR: #000000">7</span> <span style="COLOR: #000000">' : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> '</span> <span style="COLOR: #000000">8</span> <span style="COLOR: #000000">' : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> '</span> <span style="COLOR: #000000">9</span> <span style="COLOR: #000000">' : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">default</span> <span style="COLOR: #000000">:  </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '' ;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />      }</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> }</span> </span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_1146_1580_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1146_1580_Open_Text.style.display='none'; Codehighlighter1_1146_1580_Closed_Image.style.display='inline'; Codehighlighter1_1146_1580_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_1146_1580_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1146_1580_Closed_Text.style.display='none'; Codehighlighter1_1146_1580_Open_Image.style.display='inline'; Codehighlighter1_1146_1580_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">function</span> <span style="COLOR: #000000"> to_mon(a)</span> <span id="Codehighlighter1_1146_1580_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_1146_1580_Open_Text"> <span style="COLOR: #000000">{<br /><img id="Codehighlighter1_1157_1187_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1157_1187_Open_Text.style.display='none'; Codehighlighter1_1157_1187_Closed_Image.style.display='inline'; Codehighlighter1_1157_1187_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1157_1187_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1157_1187_Closed_Text.style.display='none'; Codehighlighter1_1157_1187_Open_Image.style.display='inline'; Codehighlighter1_1157_1187_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">(a</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">10</span> <span style="COLOR: #000000">)</span> <span id="Codehighlighter1_1157_1187_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_1157_1187_Open_Text"> <span style="COLOR: #000000">{ a</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">a </span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">8</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /> </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">(to_mon(a));}</span> </span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_1199_1577_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1199_1577_Open_Text.style.display='none'; Codehighlighter1_1199_1577_Closed_Image.style.display='inline'; Codehighlighter1_1199_1577_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /> <img id="Codehighlighter1_1199_1577_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1199_1577_Closed_Text.style.display='none'; Codehighlighter1_1199_1577_Open_Image.style.display='inline'; Codehighlighter1_1199_1577_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">switch</span> <span style="COLOR: #000000">(a)</span> <span id="Codehighlighter1_1199_1577_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_1199_1577_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">2</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">3</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">4</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">5</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">6</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">7</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">8</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">9</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     </span> <span style="COLOR: #0000ff">case</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #000000">10</span> <span style="COLOR: #000000"> : </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> '?; </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  <br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />         }</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> }</span> </span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_1612_2654_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1612_2654_Open_Text.style.display='none'; Codehighlighter1_1612_2654_Closed_Image.style.display='inline'; Codehighlighter1_1612_2654_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_1612_2654_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1612_2654_Closed_Text.style.display='none'; Codehighlighter1_1612_2654_Open_Image.style.display='inline'; Codehighlighter1_1612_2654_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />    </span> <span style="COLOR: #0000ff">function</span> <span style="COLOR: #000000"> repace_acc(Money)</span> <span id="Codehighlighter1_1612_2654_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_1612_2654_Open_Text"> <span style="COLOR: #000000">{  <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    Money</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">Money.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">零分</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">""</span> <span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    Money</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">Money.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">零角</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">?/span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);       <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  </span> <span style="COLOR: #0000ff">var</span> <span style="COLOR: #000000"> yy;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  </span> <span style="COLOR: #0000ff">var</span> <span style="COLOR: #000000">  outmoney;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">Money;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  yy</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">;<br /><img id="Codehighlighter1_1758_2432_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1758_2432_Open_Text.style.display='none'; Codehighlighter1_1758_2432_Closed_Image.style.display='inline'; Codehighlighter1_1758_2432_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1758_2432_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1758_2432_Closed_Text.style.display='none'; Codehighlighter1_1758_2432_Open_Image.style.display='inline'; Codehighlighter1_1758_2432_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />  </span> <span style="COLOR: #0000ff">while</span> <span style="COLOR: #000000">(</span> <span style="COLOR: #0000ff">true</span> <span style="COLOR: #000000">)</span> <span id="Codehighlighter1_1758_2432_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_1758_2432_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  </span> <span style="COLOR: #0000ff">var</span> <span style="COLOR: #000000"> lett</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.length;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">零元</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">?/span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);                                                                                    <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">零万</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">?/span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);                                                                                    <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">零亿</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">?/span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">零仟</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">?/span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);    <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">零䘪</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">?/span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);    <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">雉</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">?/span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">零拾</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">?/span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">亿万</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">争K</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">万仟</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">万零</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.replace(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">仟䘪</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">仟零</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">);    <br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  yy</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.length;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  </span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">(yy</span> <span style="COLOR: #000000">==</span> <span style="COLOR: #000000">lett) </span> <span style="COLOR: #0000ff">break</span> <span style="COLOR: #000000">;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  <br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  yy </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.length;<br /><img id="Codehighlighter1_2492_2535_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2492_2535_Open_Text.style.display='none'; Codehighlighter1_2492_2535_Closed_Image.style.display='inline'; Codehighlighter1_2492_2535_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_2492_2535_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2492_2535_Closed_Text.style.display='none'; Codehighlighter1_2492_2535_Open_Image.style.display='inline'; Codehighlighter1_2492_2535_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />  </span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000"> ( outmoney.charAt(yy</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">)</span> <span style="COLOR: #000000">==</span> <span style="COLOR: #000000">'?)</span> <span id="Codehighlighter1_2492_2535_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_2492_2535_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">outmoney.substring(</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">,yy</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />  }</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />   yy </span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000"> outmoney.length;<br /><img id="Codehighlighter1_2596_2626_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2596_2626_Open_Text.style.display='none'; Codehighlighter1_2596_2626_Closed_Image.style.display='inline'; Codehighlighter1_2596_2626_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_2596_2626_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_2596_2626_Closed_Text.style.display='none'; Codehighlighter1_2596_2626_Open_Image.style.display='inline'; Codehighlighter1_2596_2626_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />  </span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000"> ( outmoney.charAt(yy</span> <span style="COLOR: #000000">-</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">)</span> <span style="COLOR: #000000">==</span> <span style="COLOR: #000000">'?)</span> <span id="Codehighlighter1_2596_2626_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.tkk7.com/images/dot.gif" /> </span> <span id="Codehighlighter1_2596_2626_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />  outmoney</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">outmoney </span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">'?;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />  }</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />   alert(outmoney);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span> </span> <span style="COLOR: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000"></</span> <span style="COLOR: #000000">script</span> <span style="COLOR: #000000">></span> </div> <img src ="http://www.tkk7.com/piliskys/aggbug/36319.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/piliskys/" target="_blank">霚w?/a> 2006-03-20 14:34 <a href="http://www.tkk7.com/piliskys/archive/2006/03/20/36319.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ajax的l学?/title><link>http://www.tkk7.com/piliskys/archive/2006/03/20/36312.html</link><dc:creator>霚w?/dc:creator><author>霚w?/author><pubDate>Mon, 20 Mar 2006 06:01:00 GMT</pubDate><guid>http://www.tkk7.com/piliskys/archive/2006/03/20/36312.html</guid><wfw:comment>http://www.tkk7.com/piliskys/comments/36312.html</wfw:comment><comments>http://www.tkk7.com/piliskys/archive/2006/03/20/36312.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/piliskys/comments/commentRss/36312.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/piliskys/services/trackbacks/36312.html</trackback:ping><description><![CDATA[昨天做下拉框时用了http_request.responseXml但感觉又要后成又要解析xml甚是ȝQ今天用http_request.responseText反回一字符Ԍ利用javascript来解析它Q然后加入到下拉框中Q感觉不是很ȝQ而且javascript很多部分可以公用?当然Q字W串要生成一定的形式Q字W串形式如“刘德华Kandy#张学友Ejacky#”,#K是比较Ҏ的字W,一般情况下是不会用到的Q所以用它来分开下拉框的lab和text的值比较容?javascript如下 <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"><img id="Codehighlighter1_21_463_Open_Image" onclick="this.style.display='none'; Codehighlighter1_21_463_Open_Text.style.display='none'; Codehighlighter1_21_463_Closed_Image.style.display='inline'; Codehighlighter1_21_463_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_21_463_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_21_463_Closed_Text.style.display='none'; Codehighlighter1_21_463_Open_Image.style.display='inline'; Codehighlighter1_21_463_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span>function</span><span> getCctv(obj)</span><span id="Codehighlighter1_21_463_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_21_463_Open_Text"><span>{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span>//</span><span>obj是传过来的字符?/span><span><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span></span><span>var</span><span> n ,m;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span>var</span><span> cctvobj</span><span>=</span><span> document.form1.cctv.options;</span><span>//</span><span>以下插入的下拉框</span><span><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span> cctvobj.innerHTML</span><span>=</span><span>""</span><span>;</span><span>//</span><span>先把它清I?/span><span><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span>var</span><span> strr </span><span>=</span><span></span><span>new</span><span> String(obj);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span>var</span><span> textvar,labvar;<br /><img id="Codehighlighter1_206_461_Open_Image" onclick="this.style.display='none'; Codehighlighter1_206_461_Open_Text.style.display='none'; Codehighlighter1_206_461_Closed_Image.style.display='inline'; Codehighlighter1_206_461_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_206_461_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_206_461_Closed_Text.style.display='none'; Codehighlighter1_206_461_Open_Image.style.display='inline'; Codehighlighter1_206_461_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /></span><span>while</span><span>(strr.indexOf('K?)</span><span>>-</span><span>1</span><span>)</span><span id="Codehighlighter1_206_461_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><img src="http://www.tkk7.com/images/dot.gif" /></span><span id="Codehighlighter1_206_461_Open_Text"><span>{<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />n </span><span>=</span><span> strr.indexOf('#');<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />m </span><span>=</span><span> strr.indexOf('K?);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />textvar</span><span>=</span><span>strr.substring(</span><span>0</span><span>,m);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />labvar</span><span>=</span><span>strr.substring(m</span><span>+</span><span>1</span><span>,n);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />strr</span><span>=</span><span>strr.substring(n</span><span>+</span><span>1</span><span>);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> op </span><span>=</span><span> document.createElement(</span><span>"</span><span>OPTION</span><span>"</span><span>);<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> op.text</span><span>=</span><span> textvar ;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> op.value</span><span>=</span><span> labvar;<br /><img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> cctvobj.add(op);</span><span>//</span><span>加入下拉?/span><span><br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /></span><span> }</span></span><span><br /><img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div>如果在项目中q用的话Q稍改一下,只要到页面上写一个下拉框参数传入QŞ式像send_request(url,obj)//url是提交的页面,obj是得到下拉框options的名Uͼq样的话Q只要你q回面是一个Ş式如上的字符串的话,可以通用了?<img src ="http://www.tkk7.com/piliskys/aggbug/36312.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/piliskys/" target="_blank">霚w?/a> 2006-03-20 14:01 <a href="http://www.tkk7.com/piliskys/archive/2006/03/20/36312.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ajax的学习及问题http://www.tkk7.com/piliskys/archive/2006/03/20/36311.html霚w?/dc:creator>霚w?/author>Mon, 20 Mar 2006 05:58:00 GMThttp://www.tkk7.com/piliskys/archive/2006/03/20/36311.htmlhttp://www.tkk7.com/piliskys/comments/36311.htmlhttp://www.tkk7.com/piliskys/archive/2006/03/20/36311.html#Feedback0http://www.tkk7.com/piliskys/comments/commentRss/36311.htmlhttp://www.tkk7.com/piliskys/services/trackbacks/36311.html前些日子看了一下关于ajax的文章,感觉无刷新而更新局部页面的不错,因此今天特地在本了几个例子,

1Q用户名唯一性检,实例Q只要照着上面做就没有问题的?br /> 2Q做一个连动的下接框,由a下拉框得到b下拉框,当时L用一个数l返回,但不知道怎么用,如果用responseTextq回的话Q可能要用javascript解析字符Ԍ然后拼成下拉框的optionQ感觉可能比较麻烦,因此用responseXMLq回Q先在本地徏了个cctv.xml文gQ然后用send_request('/cctv.xml');时可以在本页面得C拉框Q然而用send_request('/cctv.jsp');׃能成功,cctv.jsp同样是生成cctv.xml一L面。但得到http_request.responseXML中的元素L0个,真搞不懂。思考:
1Q当看到google中的查找带出相应值来ӞZ么会q么快啊Q真的是做的不错Q不知道它的机制是如何做的?br /> 2Q对于一些多U连动下拉框的实玎ͼ一般来说都是把所以数据初始化攑օ面Q然后由javasrcipt来控制显C,q样对于一些框架及操作数据库来_只要一ơ数据库q接Q只要一ơ蟩转,而采用ajax技术的话,可能存在数据库多ơ连接和框架的多ơ蟩转,因此Q性能的优劣也要接情况而定?br /> 3Q感觉ajax面代码q多Q感觉复用较难,另外不知道能否返回一个数l或集合Q利用生成xml然后对其q行解析的话Q效率上是否有所Ơ缺?br /> ajaxq是初步了解Q望得到此方面的人的帮助?



]]>
成功三十七式Q{载)http://www.tkk7.com/piliskys/archive/2006/03/20/36309.html霚w?/dc:creator>霚w?/author>Mon, 20 Mar 2006 05:55:00 GMThttp://www.tkk7.com/piliskys/archive/2006/03/20/36309.htmlhttp://www.tkk7.com/piliskys/comments/36309.htmlhttp://www.tkk7.com/piliskys/archive/2006/03/20/36309.html#Feedback0http://www.tkk7.com/piliskys/comments/commentRss/36309.htmlhttp://www.tkk7.com/piliskys/services/trackbacks/36309.htmlW二式:前面永远最危险
W三式:莫让他h掌生?
W四式:没有永远的避风港
W五式:认清自己很重?
W六式:需意志时莫攑ּ
W七式:莫轻受诱惑出航道
W八式:凡事成功需早
W九式:乐与沟通是潜质
W十式:吃苦耐劳Q忍辱偷?
W十一式:忙中需能偷闲歇
W十二式Q保持乐观是关键
W十三式Q必要时何妨扮恐?
十四式:竞技心态常保持
W十五式Q没有永q的敌h 永远不需要在权威面前发抖
W十六式Q后Ҏ援最完美Q成功背后是女h
W十七式Q团l心态要常有
W十八式Q因才用人善驱驰
W十九式Q防Z心不可无
W二十式Q预见危机善处理
W二十一式:充分利用资源
W二十二式:动力之源是好?
W二十三式:语言能力需培养Q说服技巧不可轻
W二十四式:君子ȝ?
W二十五式:抓住问题的要?
W二十六式:只有偏执狂才能成?
W二十七式:识时务者ؓ俊杰
W二十八式:快h一步两重天
W二十九式:q求完美不可?
W三十式Q保重n体是Ҏ
W三十一式:不要L改变自己的特?
W三十二式:要适当放松自己
W三十三式:学会克服自己的恐惧感
W三十四式:永远不要q䆾低估你的Ҏ
W三十五式:从以往及他人的p|中݅取经?
W三十六式:把别人的优点学过?
最后一式:撇开工作蒙头大睡


]]>
վ֩ģ壺 ŮݽƵѿ| ëƬר| ˳վɫ| 67194ҹ| ޲AVӰƬ߲| ëƬȫ| ƷëٸAVѾþ| þþþþƷAV| 99þۺϾƷ| ߹ۿ| ߹ۿ˳Ƶɫ9| þ޾Ʒ| ִˬƵ| ŷ У԰| ޹Ů޹| þ޹| þþþ޾Ʒ | һɫþۺ޾Ʒ| Ů糱ëƬѲ | þþƷҹɫAVվ| ˾þۺӰԺ| ޸߲| ĻһëƬ| ޾Ʒ߹ۿ| Ļר| Ʒһ | ޾ƷþþþAƬԾ| ޼Ӱ| ɫվwwwþþ| Ұһ| һaëƬƵ| Ļĸ| ۺƵ| ׾Ʒһ| AV| AVר޾Ʒ| ۺavһ| ͵޾Ʒ͵һ| һëƬ| ˳Ƶ| ɫһ|