﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-No.1 Red's notes</title><link>http://www.blogjava.net/no1red/</link><description>Do more, Complain less
</description><language>zh-cn</language><lastBuildDate>Thu, 30 Apr 2026 06:23:12 GMT</lastBuildDate><pubDate>Thu, 30 Apr 2026 06:23:12 GMT</pubDate><ttl>60</ttl><item><title>Struts Validation (1)</title><link>http://www.blogjava.net/no1red/archive/2006/08/10/62820.html</link><dc:creator>Red</dc:creator><author>Red</author><pubDate>Thu, 10 Aug 2006 08:39:00 GMT</pubDate><guid>http://www.blogjava.net/no1red/archive/2006/08/10/62820.html</guid><wfw:comment>http://www.blogjava.net/no1red/comments/62820.html</wfw:comment><comments>http://www.blogjava.net/no1red/archive/2006/08/10/62820.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/no1red/comments/commentRss/62820.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/no1red/services/trackbacks/62820.html</trackback:ping><description><![CDATA[Struts Validation<br /><br />在Form中设置valiate方法实现表单中元素的检验：<br /><br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><img id="Code_Closed_Image_163309" onclick="this.style.display='none'; Code_Closed_Text_163309.style.display='none'; Code_Open_Image_163309.style.display='inline'; Code_Open_Text_163309.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" /><img id="Code_Open_Image_163309" style="display: none;" onclick="this.style.display='none'; Code_Open_Text_163309.style.display='none'; Code_Closed_Image_163309.style.display='inline'; Code_Closed_Text_163309.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" /><span id="Code_Closed_Text_163309" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255);">Form</span><span id="Code_Open_Text_163309" style="display: none;"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">   </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> ActionErrors validate(<br />            ActionMapping mapping,<br />            HttpServletRequest request) {<br />                <br />        ActionErrors errors </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ActionErrors();<br />                <br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(getName().equals(</span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);">)){<br />            errors.add(ActionMessages.GLOBAL_MESSAGE,<br />                </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ActionMessage(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">login.error.name.required</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />        }<br />                <br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(getPassword().equals(</span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);">)){<br />            errors.add(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">passError</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ActionMessage(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">login.error.password.requrired</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">str</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />        }<br />                <br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> errors;<br />    }</span></span></div><br />       <br />       在form中，如果有ActionErrors错误，会自动回到输入见面。<br /><br />       将错误信息返回的方法，如下：<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><img id="Code_Closed_Image_163401" onclick="this.style.display='none'; Code_Closed_Text_163401.style.display='none'; Code_Open_Image_163401.style.display='inline'; Code_Open_Text_163401.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" /><img id="Code_Open_Image_163401" style="display: none;" onclick="this.style.display='none'; Code_Open_Text_163401.style.display='none'; Code_Closed_Image_163401.style.display='inline'; Code_Closed_Text_163401.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" /><span id="Code_Closed_Text_163401" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255);">Jsp</span><span id="Code_Open_Text_163401" style="display: none;"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">html:messages </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="msg"</span><span style="color: rgb(255, 0, 0);"> property</span><span style="color: rgb(0, 0, 255);">="passError"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">  --- 无 property 默认输出所有错误信息<br />          </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean:write </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="msg"</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">html:messages</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    <br />    其中，html:message 替代 html:errors<br /><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">html:errors</span><span style="color: rgb(0, 0, 255);">/&gt;</span></span></div><br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><img id="Code_Closed_Image_163443" onclick="this.style.display='none'; Code_Closed_Text_163443.style.display='none'; Code_Open_Image_163443.style.display='inline'; Code_Open_Text_163443.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" /><img id="Code_Open_Image_163443" style="display: none;" onclick="this.style.display='none'; Code_Open_Text_163443.style.display='none'; Code_Closed_Image_163443.style.display='inline'; Code_Closed_Text_163443.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" /><span id="Code_Closed_Text_163443" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255);">Action</span><span id="Code_Open_Text_163443" style="display: none;"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">no1red</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">.equals(name)){<br />        ActionMessages messages </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ActionMessages();<br />        messages.add(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">nameMessages</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ActionMessage(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">login.error.name.match</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />        messages.add(ActionMessages.GLOBAL_MESSAGE,</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> ActionMessage(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">login.error</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />        saveMessages(request,messages);<br />        request.setAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">nameMatch</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, messages);<br />        </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> mapping.findForward(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">fail</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />    }<br />    </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> mapping.findForward(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">succ</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);</span></span></div><br /><br />Jsp:<br /><br />    第一种用saveMessages的方法，在页面中显示错误信息：<br /><br />    saveMessages(request,messages);<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><img id="Code_Closed_Image_163646" onclick="this.style.display='none'; Code_Closed_Text_163646.style.display='none'; Code_Open_Image_163646.style.display='inline'; Code_Open_Text_163646.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" /><img id="Code_Open_Image_163646" style="display: none;" onclick="this.style.display='none'; Code_Open_Text_163646.style.display='none'; Code_Closed_Image_163646.style.display='inline'; Code_Closed_Text_163646.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" /><span id="Code_Closed_Text_163646" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255);"></span><span id="Code_Open_Text_163646" style="display: none;"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">html:messages message</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">true</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">msg</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> property</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">nameMessages</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 0);">&lt;%=</span><span style="color: rgb(0, 0, 0);"> pageContext.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">msg</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);">          <br />    </span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">html:messages</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    <br />    property 的名称 nameMessages 和 Action 中的 nameMessages 向对应。    <br /><br />    或者将 </span><span style="color: rgb(0, 0, 0);">&lt;%=</span><span style="color: rgb(0, 0, 0);"> pageContext.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">msg</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);"> 用 </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">bean:write name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">msg</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);"> 来替代。<br />    <br />    </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">html:messages id</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">msg</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> message</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">true</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);">  </span><span style="color: rgb(0, 0, 0);">----</span><span style="color: rgb(0, 0, 0);"> 输出所有错误消息<br />         </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">bean:write name</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">msg</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">/&gt;</span><span style="color: rgb(0, 0, 0);">     <br />    </span><span style="color: rgb(0, 0, 0);">&lt;/</span><span style="color: rgb(0, 0, 0);">html:messages</span><span style="color: rgb(0, 0, 0);">&gt;</span></span></div><br />    <br />    第二种方法，用request.saveAttribute：<br />    <br />    request.setAttribute("nameMatch", messages);<br />    <br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><img id="Code_Closed_Image_163739" onclick="this.style.display='none'; Code_Closed_Text_163739.style.display='none'; Code_Open_Image_163739.style.display='inline'; Code_Open_Text_163739.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" /><img id="Code_Open_Image_163739" style="display: none;" onclick="this.style.display='none'; Code_Open_Text_163739.style.display='none'; Code_Closed_Image_163739.style.display='inline'; Code_Closed_Text_163739.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" /><span id="Code_Closed_Text_163739" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255);"></span><span id="Code_Open_Text_163739" style="display: none;"><br /><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">logic:messagesPresent </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="nameMatch"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">table </span><span style="color: rgb(255, 0, 0);">border</span><span style="color: rgb(0, 0, 255);">="1"</span><span style="color: rgb(255, 0, 0);"> bgcolor</span><span style="color: rgb(0, 0, 255);">="yellow"</span><span style="color: rgb(255, 0, 0);"> width</span><span style="color: rgb(0, 0, 255);">="100%"</span><span style="color: rgb(255, 0, 0);"> align</span><span style="color: rgb(0, 0, 255);">="center"</span><span style="color: rgb(0, 0, 255);">&gt;&lt;</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">&gt;&lt;</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">img </span><span style="color: rgb(255, 0, 0);">src</span><span style="color: rgb(0, 0, 255);">="/images/icon-warning.gif"</span><span style="color: rgb(255, 0, 0);"> border</span><span style="color: rgb(0, 0, 255);">="0"</span><span style="color: rgb(255, 0, 0);"><br />                  vspace</span><span style="color: rgb(0, 0, 255);">="2"</span><span style="color: rgb(255, 0, 0);"> hspace</span><span style="color: rgb(0, 0, 255);">="10"</span><span style="color: rgb(255, 0, 0);"> align</span><span style="color: rgb(0, 0, 255);">="center"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">bean:message </span><span style="color: rgb(255, 0, 0);">key</span><span style="color: rgb(0, 0, 255);">="warnings.heading"</span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">    <br />            </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">ul</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">html:messages </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="error"</span><span style="color: rgb(255, 0, 0);"> name</span><span style="color: rgb(0, 0, 255);">="nameMatch"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                   </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">li</span><span style="color: rgb(0, 0, 255);">&gt;&lt;</span><span style="color: rgb(128, 0, 0);">bean:write </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="error"</span><span style="color: rgb(0, 0, 255);">/&gt;&lt;/</span><span style="color: rgb(128, 0, 0);">li</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">html:messages</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />            </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">ul</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">td</span><span style="color: rgb(0, 0, 255);">&gt;&lt;/</span><span style="color: rgb(128, 0, 0);">tr</span><span style="color: rgb(0, 0, 255);">&gt;&lt;/</span><span style="color: rgb(128, 0, 0);">table</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">p</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />   </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">logic:messagesPresent</span><span style="color: rgb(0, 0, 255);">&gt;</span></span></div><br />    <br /><br /><img src ="http://www.blogjava.net/no1red/aggbug/62820.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/no1red/" target="_blank">Red</a> 2006-08-10 16:39 <a href="http://www.blogjava.net/no1red/archive/2006/08/10/62820.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclispe3.2 + MyEclipse 5.0 GA + crack</title><link>http://www.blogjava.net/no1red/archive/2006/08/10/62808.html</link><dc:creator>Red</dc:creator><author>Red</author><pubDate>Thu, 10 Aug 2006 07:51:00 GMT</pubDate><guid>http://www.blogjava.net/no1red/archive/2006/08/10/62808.html</guid><wfw:comment>http://www.blogjava.net/no1red/comments/62808.html</wfw:comment><comments>http://www.blogjava.net/no1red/archive/2006/08/10/62808.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.blogjava.net/no1red/comments/commentRss/62808.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/no1red/services/trackbacks/62808.html</trackback:ping><description><![CDATA[
		<font size="3">觉得5.0会变慢,但装完后的初步感觉是速度提升了,尤其是打开jsp文件时，编辑模式初始化的过程见不到了。装之前，最好卸载原有的MyEclipse，解压新的Eclipse3.2.当然jdk5肯定是必备的了。<br /><br /><a href="http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.2-200606291905/eclipse-SDK-3.2-win32.zip&amp;url=http://eclipse.objectweb.org/downloads/drops/R-3.2-200606291905/eclipse-SDK-3.2-win32.zip&amp;mirror_id=15">Eclipse3.2</a>  <br /><br /></font>
		<font size="3">
				<a href="http://downloads.myeclipseide.com/downloads/products/eworkbench/5.0GA/MyEclipseEnterpriseWorkbenchInstaller_5.0GA_E3.2.exe">MyEclipse5.0GA</a> (链接用工具下,或直接贴入浏览器地址栏)<br /><br />一个名字为Crack的java文件.做javac,java操作.(破解文件用4.x的也可以)</font>
		<br />
		<br />
		<font size="1">
		</font>
		<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;">
				<img id="Code_Closed_Image_154011" onclick="this.style.display='none'; Code_Closed_Text_154011.style.display='none'; Code_Open_Image_154011.style.display='inline'; Code_Open_Text_154011.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align="top" height="16" width="11" />
				<img id="Code_Open_Image_154011" style="display: none;" onclick="this.style.display='none'; Code_Open_Text_154011.style.display='none'; Code_Closed_Image_154011.style.display='inline'; Code_Closed_Text_154011.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" height="16" width="11" />
				<span id="Code_Closed_Text_154011" style="border: 1px solid rgb(128, 128, 128); background-color: rgb(255, 255, 255);">Crack.java</span>
				<span id="Code_Open_Text_154011" style="display: none;">
						<br />
						<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->
						<span style="color: rgb(0, 0, 255);">import</span>
						<span style="color: rgb(0, 0, 0);"> java.io.</span>
						<span style="color: rgb(0, 0, 0);">*</span>
						<span style="color: rgb(0, 0, 0);">;<br /><br /></span>
						<span style="color: rgb(0, 128, 0);">/**</span>
						<span style="color: rgb(0, 128, 0);">
								<br /> *<br /> * modify by TOTO<br /> * totongf@hotmail.com<br /> * 2005-10-24<br /> </span>
						<span style="color: rgb(0, 128, 0);">*/</span>
						<span style="color: rgb(0, 0, 0);">
								<br />
						</span>
						<span style="color: rgb(0, 0, 255);">public</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">class</span>
						<span style="color: rgb(0, 0, 0);"> Crack {<br />    </span>
						<span style="color: rgb(0, 0, 255);">public</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">static</span>
						<span style="color: rgb(0, 0, 0);"> String convert(String s) {<br />        </span>
						<span style="color: rgb(0, 0, 255);">if</span>
						<span style="color: rgb(0, 0, 0);"> (s </span>
						<span style="color: rgb(0, 0, 0);">==</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">null</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">||</span>
						<span style="color: rgb(0, 0, 0);"> s.length() </span>
						<span style="color: rgb(0, 0, 0);">==</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">0</span>
						<span style="color: rgb(0, 0, 0);">)<br />            </span>
						<span style="color: rgb(0, 0, 255);">return</span>
						<span style="color: rgb(0, 0, 0);"> s;<br />        </span>
						<span style="color: rgb(0, 0, 255);">byte</span>
						<span style="color: rgb(0, 0, 0);"> abyte0[] </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> s.getBytes();<br />        </span>
						<span style="color: rgb(0, 0, 255);">char</span>
						<span style="color: rgb(0, 0, 0);"> ac[] </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">new</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">char</span>
						<span style="color: rgb(0, 0, 0);">[s.length()];<br />        </span>
						<span style="color: rgb(0, 0, 255);">int</span>
						<span style="color: rgb(0, 0, 0);"> i </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">0</span>
						<span style="color: rgb(0, 0, 0);">;<br />        </span>
						<span style="color: rgb(0, 0, 255);">for</span>
						<span style="color: rgb(0, 0, 0);"> (</span>
						<span style="color: rgb(0, 0, 255);">int</span>
						<span style="color: rgb(0, 0, 0);"> k </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> abyte0.length; i </span>
						<span style="color: rgb(0, 0, 0);">&lt;</span>
						<span style="color: rgb(0, 0, 0);"> k; i</span>
						<span style="color: rgb(0, 0, 0);">++</span>
						<span style="color: rgb(0, 0, 0);">) {<br />            </span>
						<span style="color: rgb(0, 0, 255);">int</span>
						<span style="color: rgb(0, 0, 0);"> j </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> abyte0[i];<br />            </span>
						<span style="color: rgb(0, 0, 255);">if</span>
						<span style="color: rgb(0, 0, 0);"> (j </span>
						<span style="color: rgb(0, 0, 0);">&gt;=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">48</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">&amp;&amp;</span>
						<span style="color: rgb(0, 0, 0);"> j </span>
						<span style="color: rgb(0, 0, 0);">&lt;=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">57</span>
						<span style="color: rgb(0, 0, 0);">)<br />                j </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> ((j </span>
						<span style="color: rgb(0, 0, 0);">-</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">48</span>
						<span style="color: rgb(0, 0, 0);">) </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">5</span>
						<span style="color: rgb(0, 0, 0);">) </span>
						<span style="color: rgb(0, 0, 0);">%</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">10</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">48</span>
						<span style="color: rgb(0, 0, 0);">;<br />            </span>
						<span style="color: rgb(0, 0, 255);">else</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">if</span>
						<span style="color: rgb(0, 0, 0);"> (j </span>
						<span style="color: rgb(0, 0, 0);">&gt;=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">65</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">&amp;&amp;</span>
						<span style="color: rgb(0, 0, 0);"> j </span>
						<span style="color: rgb(0, 0, 0);">&lt;=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">90</span>
						<span style="color: rgb(0, 0, 0);">)<br />                j </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> ((j </span>
						<span style="color: rgb(0, 0, 0);">-</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">65</span>
						<span style="color: rgb(0, 0, 0);">) </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">13</span>
						<span style="color: rgb(0, 0, 0);">) </span>
						<span style="color: rgb(0, 0, 0);">%</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">26</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">65</span>
						<span style="color: rgb(0, 0, 0);">;<br />            </span>
						<span style="color: rgb(0, 0, 255);">else</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">if</span>
						<span style="color: rgb(0, 0, 0);"> (j </span>
						<span style="color: rgb(0, 0, 0);">&gt;=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">97</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">&amp;&amp;</span>
						<span style="color: rgb(0, 0, 0);"> j </span>
						<span style="color: rgb(0, 0, 0);">&lt;=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">122</span>
						<span style="color: rgb(0, 0, 0);">)<br />                j </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> ((j </span>
						<span style="color: rgb(0, 0, 0);">-</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">97</span>
						<span style="color: rgb(0, 0, 0);">) </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">13</span>
						<span style="color: rgb(0, 0, 0);">) </span>
						<span style="color: rgb(0, 0, 0);">%</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">26</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">97</span>
						<span style="color: rgb(0, 0, 0);">;<br />            ac[i] </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> (</span>
						<span style="color: rgb(0, 0, 255);">char</span>
						<span style="color: rgb(0, 0, 0);">) j;<br />        }<br />        </span>
						<span style="color: rgb(0, 0, 255);">return</span>
						<span style="color: rgb(0, 0, 0);"> String.valueOf(ac);<br />    }<br /><br />    </span>
						<span style="color: rgb(0, 0, 255);">private</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">static</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">int</span>
						<span style="color: rgb(0, 0, 0);"> hash(String s) {<br />        </span>
						<span style="color: rgb(0, 0, 255);">int</span>
						<span style="color: rgb(0, 0, 0);"> i </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">0</span>
						<span style="color: rgb(0, 0, 0);">;<br />        </span>
						<span style="color: rgb(0, 0, 255);">char</span>
						<span style="color: rgb(0, 0, 0);"> ac[] </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> s.toCharArray();<br />        </span>
						<span style="color: rgb(0, 0, 255);">int</span>
						<span style="color: rgb(0, 0, 0);"> j </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">0</span>
						<span style="color: rgb(0, 0, 0);">;<br />        </span>
						<span style="color: rgb(0, 0, 255);">for</span>
						<span style="color: rgb(0, 0, 0);"> (</span>
						<span style="color: rgb(0, 0, 255);">int</span>
						<span style="color: rgb(0, 0, 0);"> k </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> ac.length; j </span>
						<span style="color: rgb(0, 0, 0);">&lt;</span>
						<span style="color: rgb(0, 0, 0);"> k; j</span>
						<span style="color: rgb(0, 0, 0);">++</span>
						<span style="color: rgb(0, 0, 0);">)<br />            i </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">31</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">*</span>
						<span style="color: rgb(0, 0, 0);"> i </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> ac[j];<br />        </span>
						<span style="color: rgb(0, 0, 255);">return</span>
						<span style="color: rgb(0, 0, 0);"> Math.abs(i);<br />    }<br /><br />    </span>
						<span style="color: rgb(0, 0, 255);">private</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">static</span>
						<span style="color: rgb(0, 0, 0);"> String inputString() {<br />        BufferedReader bufferedreader </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">new</span>
						<span style="color: rgb(0, 0, 0);"> BufferedReader(<br />                </span>
						<span style="color: rgb(0, 0, 255);">new</span>
						<span style="color: rgb(0, 0, 0);"> InputStreamReader(System.in));<br />        String s </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">null</span>
						<span style="color: rgb(0, 0, 0);">;<br />        </span>
						<span style="color: rgb(0, 0, 255);">try</span>
						<span style="color: rgb(0, 0, 0);"> {<br />            s </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> bufferedreader.readLine();<br />        } </span>
						<span style="color: rgb(0, 0, 255);">catch</span>
						<span style="color: rgb(0, 0, 0);"> (IOException ioexception) {<br />            ioexception.printStackTrace();<br />        }<br />        </span>
						<span style="color: rgb(0, 0, 255);">return</span>
						<span style="color: rgb(0, 0, 0);"> s;<br />    }<br /><br />    </span>
						<span style="color: rgb(0, 0, 255);">public</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">static</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 255);">void</span>
						<span style="color: rgb(0, 0, 0);"> main(String args[]) {<br />        </span>
						<span style="color: rgb(0, 0, 255);">try</span>
						<span style="color: rgb(0, 0, 0);"> {<br />            System.out.println(</span>
						<span style="color: rgb(0, 0, 0);">"</span>
						<span style="color: rgb(0, 0, 0);">My Eclipse IDE v9.99 Keygen</span>
						<span style="color: rgb(0, 0, 0);">"</span>
						<span style="color: rgb(0, 0, 0);">);<br />            System.out.print(</span>
						<span style="color: rgb(0, 0, 0);">"</span>
						<span style="color: rgb(0, 0, 0);">License Name : </span>
						<span style="color: rgb(0, 0, 0);">"</span>
						<span style="color: rgb(0, 0, 0);">);<br />            String s </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> inputString();<br />            String licStr </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">"</span>
						<span style="color: rgb(0, 0, 0);">YE3MP-999-00-9912310</span>
						<span style="color: rgb(0, 0, 0);">"</span>
						<span style="color: rgb(0, 0, 0);">;<br />            String h </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> s.substring(</span>
						<span style="color: rgb(0, 0, 0);">0</span>
						<span style="color: rgb(0, 0, 0);">, </span>
						<span style="color: rgb(0, 0, 0);">1</span>
						<span style="color: rgb(0, 0, 0);">)<br />                    </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> licStr<br />                    </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">"</span>
						<span style="color: rgb(0, 0, 0);">Decompiling this copyrighted software is a violation of both your license agreement and the Digital Millenium Copyright Act of 1998 (http://www.loc.gov/copyright/legislation/dmca.pdf). Under section 1204 of the DMCA, penalties range up to a $500,000 fine or up to five years imprisonment for a first offense. Think about it; pay for a license, avoid prosecution, and feel better about yourself.</span>
						<span style="color: rgb(0, 0, 0);">"</span>
						<span style="color: rgb(0, 0, 0);">
								<br />                    </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> s;<br />            </span>
						<span style="color: rgb(0, 0, 255);">int</span>
						<span style="color: rgb(0, 0, 0);"> j </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> hash(h);<br /><br />            String lic </span>
						<span style="color: rgb(0, 0, 0);">=</span>
						<span style="color: rgb(0, 0, 0);"> s.substring(</span>
						<span style="color: rgb(0, 0, 0);">0</span>
						<span style="color: rgb(0, 0, 0);">, </span>
						<span style="color: rgb(0, 0, 0);">1</span>
						<span style="color: rgb(0, 0, 0);">) </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> licStr </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> Integer.toString(j);<br />            System.out.println(</span>
						<span style="color: rgb(0, 0, 0);">"</span>
						<span style="color: rgb(0, 0, 0);">License Key  : </span>
						<span style="color: rgb(0, 0, 0);">"</span>
						<span style="color: rgb(0, 0, 0);"> </span>
						<span style="color: rgb(0, 0, 0);">+</span>
						<span style="color: rgb(0, 0, 0);"> convert(lic));<br />        } </span>
						<span style="color: rgb(0, 0, 255);">catch</span>
						<span style="color: rgb(0, 0, 0);"> (Exception exception) {<br />            exception.printStackTrace();<br />        }<br />    }<br />}</span>
				</span>
		</div>
		<br />
<img src ="http://www.blogjava.net/no1red/aggbug/62808.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/no1red/" target="_blank">Red</a> 2006-08-10 15:51 <a href="http://www.blogjava.net/no1red/archive/2006/08/10/62808.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>