??xml version="1.0" encoding="utf-8" standalone="yes"?>色哟哟在线观看,欧美色欧美亚洲另类七区,动漫黄在线观看http://www.aygfsteel.com/huanghuizz/category/14530.htmlzh-cnSun, 19 Jul 2009 13:27:07 GMTSun, 19 Jul 2009 13:27:07 GMT60DOCTYPE! HTML PUBLIC 声明规范http://www.aygfsteel.com/huanghuizz/articles/287340.html七匹?/dc:creator>七匹?/author>Sun, 19 Jul 2009 08:08:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/287340.htmlhttp://www.aygfsteel.com/huanghuizz/comments/287340.htmlhttp://www.aygfsteel.com/huanghuizz/articles/287340.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/287340.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/287340.html

DOCTYPE的常用声明:(x)按照 HTML 4.01 XHTML 1.0 XHTML 1.1 列表如下Q错误的DOCTYPE HTML PUBLIC反而会(x)D面解析错误?/p>

HTML 4.01规范分ؓ(f)QStrict, Transitional, Frameset

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

 

XHTML 1.0规范分ؓ(f)QStrict, Transitional, Frameset

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

 

XHTML 1.1 DTD

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">


]]>
tomcat 调优?sh)?qing)jconsole监控 配置http://www.aygfsteel.com/huanghuizz/articles/257060.html七匹?/dc:creator>七匹?/author>Fri, 27 Feb 2009 08:26:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/257060.htmlhttp://www.aygfsteel.com/huanghuizz/comments/257060.htmlhttp://www.aygfsteel.com/huanghuizz/articles/257060.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/257060.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/257060.html
上面是在本地监测Q如果远E监,如下Q?br />
要实现远E监控还要与IPl定Q添加参敎ͼ(x)
    -Djava.rmi.server.hostname=192.168.10.31

    若要实现使用用户名登陆,修改参数-Dcom.sun.management.jmxremote.authenticate=trueQ?br />     d启动参数Q?Dcom.sun.management.jmxremote.password.file=$JAVA_HOME/jre/lib/management/jmxremote.password Q?br /> 然后q行以下配置Q?br /> 1. ?JRE_HOME/lib/management/jmxremote.password.template拯?/code>jmxremote.password?br /> 2. L此目录下 jmxremote.access 最后两行的注释Q这个存的就是用户名和权限?br /> 3. 对应的,L jmxremote.password 最后两行注释,q个是用户名和对应的密码?br /> 4. 通过d和修改这两个文g来管理登陆用戗?br />
最后,要修?code>jmxremote.password
文g的权限chkmod 600 jmxremote.password?br />    可以在Jconsole里实现远E监控了(jin)Q?br />    q程q程 192.168.10.31:8950
   ?service:jmx:rmi:///jndi/rmi://192.168.10.31:8950/jmxrmi


]]>
java性能?,5个用?/title><link>http://www.aygfsteel.com/huanghuizz/articles/255909.html</link><dc:creator>七匹?/dc:creator><author>七匹?/author><pubDate>Fri, 20 Feb 2009 15:58:00 GMT</pubDate><guid>http://www.aygfsteel.com/huanghuizz/articles/255909.html</guid><wfw:comment>http://www.aygfsteel.com/huanghuizz/comments/255909.html</wfw:comment><comments>http://www.aygfsteel.com/huanghuizz/articles/255909.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/huanghuizz/comments/commentRss/255909.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/huanghuizz/services/trackbacks/255909.html</trackback:ping><description><![CDATA[<ol class="dp-j"> <li><span><span id="wmqeeuq" class="keyword">private</span><span> </span><span id="wmqeeuq" class="keyword">static</span><span> Credit BaseCredit = </span><span id="wmqeeuq" class="keyword">new</span><span> Credit();   </span></span> </li> <li><span id="wmqeeuq" class="keyword">public</span><span> </span><span id="wmqeeuq" class="keyword">static</span><span> Credit getNewCredit() {   </span> </li> <li><span id="wmqeeuq" class="keyword">return</span><span> (Credit) BaseCredit.clone();   </span> </li> <li><span>}   </span> </li> </ol> <pre class="java" style="display: none;" name="code">private static Credit BaseCredit = new Credit(); public static Credit getNewCredit() { return (Credit) BaseCredit.clone(); } </pre> <p> Java语言?fn)惯用?br /> <strong>1.循环</strong><br />       ?在重要的循环里,消除循环l止判断时的Ҏ(gu)调用。。?br />       例如Q将...bt   <a >www.bt285.cn</a>      </p> <div id="wmqeeuq" class="dp-highlighter"><span><span id="wmqeeuq" class="keyword">for</span><span>(</span><span id="wmqeeuq" class="keyword">int</span><span> i=</span><span id="wmqeeuq" class="number">0</span><span>; i<collection.size();i++){   </span></span> <ol class="dp-j"> <li><span>       ...   </span> </li> <li><span>      }  </span> </li> </ol> </div> <pre class="java" style="display: none;" name="code">for(int i=0; i<collection.size();i++){ ... } </pre> <p> </p> <p>      替换?#8230;<br />       </p> <div id="wmqeeuq" class="dp-highlighter"> <ol class="dp-j"> <li><span><span id="wmqeeuq" class="keyword">for</span><span>(</span><span id="wmqeeuq" class="keyword">int</span><span> i=</span><span id="wmqeeuq" class="number">0</span><span>; n=collection.size();i<n;i++){   </span></span> </li> <li><span>       ...   </span> </li> <li><span>      }  </span> </li> </ol> </div> <pre class="java" style="display: none;" name="code">for(int i=0; n=collection.size();i<n;i++){ ... } </pre> <p> </p> <p>      ?通常Q把与@环index不相关的Ud循环的外?br />      </p> <div id="wmqeeuq" class="dp-highlighter"> <div id="wmqeeuq" class="bar"> </div> <ol class="dp-j"> <li><span><span id="wmqeeuq" class="keyword">for</span><span>(</span><span id="wmqeeuq" class="keyword">int</span><span> i=</span><span id="wmqeeuq" class="number">0</span><span>; terminal=x.length;i<terminal;i++){   </span></span> </li> <li><span>        x[i] = x[i]/scaleA *scaleB;   </span> </li> <li><span>     }  </span> </li> </ol> </div> <pre class="java" style="display: none;" name="code"> for(int i=0; terminal=x.length;i<terminal;i++){ x[i] = x[i]/scaleA *scaleB; } </pre> <p> </p> <p>      应该该成Q?br />       </p> <div id="wmqeeuq" class="dp-highlighter"> <div id="wmqeeuq" class="bar"> </div> <ol class="dp-j"> <li><span><span>Double scale =  scaleB*scaleA;   </span></span> </li> <li><span>      </span><span id="wmqeeuq" class="keyword">for</span><span>(</span><span id="wmqeeuq" class="keyword">int</span><span> i=</span><span id="wmqeeuq" class="number">0</span><span>; terminal=x.length;i<terminal;i++){   </span> </li> <li><span>         x[i] = x[i]/scale ;   </span> </li> <li><span>      }  </span> </li> </ol> </div> <pre class="java" style="display: none;" name="code">Double scale = scaleB*scaleA; for(int i=0; terminal=x.length;i<terminal;i++){ x[i] = x[i]/scale ; } </pre> <p> </p> <p><strong>2.字符?/strong><br />      ?消除字符串连?br />      ?创徏长字W串ӞL使用StringBuffter代替String<br />      ?预先分配StringBufferI间   StringBuffer sb = new StringBuffer(5000);</p> <p><strong></strong></p> <p><strong>3.基本数据cd<br /> </strong>     ?在重要的循环里用基本数据类型(int型数据通常比long/double型数据更快)(j)<br />      ?基本数据cdQBoolean,Integer,etcQ的包装cM要用在当传递的Ҏ(gu)参数必须是一个对象的引用Ӟ而不是一个基本数据类型)(j)<br />      ?Ҏ(gu)有的帔R代数表达式用static final修饰W?br />      ?使常量更Ҏ(gu)引用Q编译器预先计算帔R表达式)(j)</p> <p> </p> <p><strong>4.异常</strong><br />      ?异常只用于单个真正的错误条g 如小?20|?<a >www.5a520.cn</a> 抛出异常?br />          抛出一个异常和执行一个catch代码块花Ҏ(gu)很高的(主要׃当创Z个异常时要获得线E栈的一个快照)(j)<br />          只当条g真的异常时才抛出一个异?/p> <p>     ?抛出异常首先要创Z个新的对象?/p> <p>         Throwable接口的构造函数调用名为fillInStackTrace()的本圎ͼNativeQ方法,fillInStackTrace()Ҏ(gu)(g)查堆栈,攉调用跟踪信息?/p> <p>         只要有异常被抛出QVM必调整调用堆栈,因ؓ(f)在处理过E中创徏?jin)一个新的对象?</p> <p>     异常只能用于错误处理Q不应该用来控制E序程?br />      ?使编译器和运行时最优化Q将几个Ҏ(gu)调用攑֜一个try/catch块中Q而不是ؓ(f)每个Ҏ(gu)调用实现几个try/catch?/p> <p>      </p> <div id="wmqeeuq" class="dp-highlighter"> <div id="wmqeeuq" class="bar"> </div> <ol class="dp-j"> <li><span><span id="wmqeeuq" class="keyword">try</span><span>{   </span></span> </li> <li><span>        Some.method1();   </span><span id="wmqeeuq" class="comment">//Difficut for java1.4 </span><span>  </span> </li> <li><span>    }</span><span id="wmqeeuq" class="keyword">catch</span><span>(method1Exception e){   </span> </li> <li><span>        handle exception </span><span id="wmqeeuq" class="number">1</span><span>  </span><span id="wmqeeuq" class="comment">// to optimize this code </span><span>  </span> </li> <li><span>    }   </span> </li> <li><span>         </span> </li> <li><span id="wmqeeuq" class="keyword">try</span><span>{   </span> </li> <li><span>        Some.method2();   </span><span id="wmqeeuq" class="comment">//Difficut for java1.4 </span><span>  </span> </li> <li><span>     }</span><span id="wmqeeuq" class="keyword">catch</span><span>(method2Exception e){   </span> </li> <li><span>        handle exception </span><span id="wmqeeuq" class="number">2</span><span>  </span><span id="wmqeeuq" class="comment">// to optimize this code </span><span>  </span> </li> <li><span>     }   </span> </li> <li><span>         </span> </li> <li><span id="wmqeeuq" class="keyword">try</span><span>{   </span> </li> <li><span>         Some.method3();   </span><span id="wmqeeuq" class="comment">//Difficut for java1.4 </span><span>  </span> </li> <li><span>     }</span><span id="wmqeeuq" class="keyword">catch</span><span>(method3Exception e){   </span> </li> <li><span>        handle exception </span><span id="wmqeeuq" class="number">3</span><span>  </span><span id="wmqeeuq" class="comment">// to optimize this code </span><span>  </span> </li> <li><span>    }  </span> </li> </ol> </div> <pre class="java" style="display: none;" name="code">try{ Some.method1(); //Difficut for java1.4 }catch(method1Exception e){ handle exception 1 // to optimize this code } try{ Some.method2(); //Difficut for java1.4 }catch(method2Exception e){ handle exception 2 // to optimize this code } try{ Some.method3(); //Difficut for java1.4 }catch(method3Exception e){ handle exception 3 // to optimize this code } </pre> <p> </p> <p>   应该写ؓ(f)Q?/p> <div id="wmqeeuq" class="dp-highlighter"> <div id="wmqeeuq" class="bar"> </div> <ol class="dp-j"> <li><span><span id="wmqeeuq" class="keyword">try</span><span>{   </span></span> </li> <li><span>      Some.method1();      </span> </li> <li><span>      Some.method2();      </span> </li> <li><span>      Some.method3();   </span><span id="wmqeeuq" class="comment">//Difficut for java1.4 </span><span>  </span> </li> <li><span>   }</span><span id="wmqeeuq" class="keyword">catch</span><span>(method1Exception e){   </span> </li> <li><span>       handle exception </span><span id="wmqeeuq" class="number">1</span><span>     </span> </li> <li><span>   }</span><span id="wmqeeuq" class="keyword">catch</span><span>(method2Exception e){   </span> </li> <li><span>       handle exception </span><span id="wmqeeuq" class="number">2</span><span>     </span> </li> <li><span>   }</span><span id="wmqeeuq" class="keyword">catch</span><span>(method3Exception e){   </span> </li> <li><span>       handle exception </span><span id="wmqeeuq" class="number">3</span><span>     </span> </li> <li><span>   }  </span> </li> </ol> </div> <pre class="java" style="display: none;" name="code">try{ Some.method1(); Some.method2(); Some.method3(); //Difficut for java1.4 }catch(method1Exception e){ handle exception 1 }catch(method2Exception e){ handle exception 2 }catch(method3Exception e){ handle exception 3 } </pre> <p><strong></strong> </p> <p><strong>5.基准</strong></p> <p>     ?注意Q所有这些技巧会(x)因不同的q_和虚拟机而不?br />          一 例如Q在有些servlet容器内,通过一个OutputStream作ؓ(f)字节输出?x)更?br />          一 在其它的容器内,通过一个PrintWriter输出字符?x)更?br />      ?q些技巧描q的是最可移植的<br />      ?你可能需要运行一些基准来判断在你的^C怎么h最快的</p> <p><strong></strong> </p> <p><strong>6.不用new关键词创建类的实?/strong> </p> <p>     ■用new关键词创建类的实例时Q构造函数链中的所有构造函数都?x)被自动调用?/p> <p>        但如果一个对象实C(jin)Cloneable接口Q我们可以调用它的clone()Ҏ(gu)。clone()Ҏ(gu)不会(x)调用McL造函数?/p> <p>        在用设计模式(Design PatternQ的场合Q如果用Factory模式创徏对象Q则改用clone()Ҏ(gu)创徏新的对象实例非常单?/p> <p>        例如Q下面是Factory模式的一个典型实玎ͼ(x)</p> <p>         </p> <div id="wmqeeuq" class="dp-highlighter"> <div id="wmqeeuq" class="bar"> </div> <ol class="dp-j"> <li><span><span id="wmqeeuq" class="keyword">public</span><span> </span><span id="wmqeeuq" class="keyword">static</span><span> Credit getNewCredit() {   </span></span> </li> <li><span>   </span><span id="wmqeeuq" class="keyword">return</span><span> </span><span id="wmqeeuq" class="keyword">new</span><span> Credit();   </span> </li> <li><span>  }   </span> </li> </ol> </div> <pre class="java" style="display: none;" name="code">public static Credit getNewCredit() { return new Credit(); } </pre> <p>        优化后:(x)</p> <div id="wmqeeuq" class="dp-highlighter"> <div id="wmqeeuq" class="bar"> </div> <ol class="dp-j"> <li><span><span id="wmqeeuq" class="keyword">private</span><span> </span><span id="wmqeeuq" class="keyword">static</span><span> Credit BaseCredit = </span><span id="wmqeeuq" class="keyword">new</span><span> Credit();   </span></span> </li> <li><span id="wmqeeuq" class="keyword">public</span><span> </span><span id="wmqeeuq" class="keyword">static</span><span> Credit getNewCredit() {   </span> </li> <li><span>    </span><span id="wmqeeuq" class="keyword">return</span><span> (Credit) BaseCredit.clone();   </span> </li> <li><span>}   </span> </li> </ol> </div> <pre class="java" style="display: none;" name="code">private static Credit BaseCredit = new Credit(); public static Credit getNewCredit() { return (Credit) BaseCredit.clone(); } </pre> <p>       上面的思\对于数组处理同样很有用?/p> <p>      </p> <p><strong>7.使用非阻塞I/O</strong> <strong> </strong></p> <p><strong>      </strong>?strong>Java</strong>版本较低的JDK不支持非dI/O API。ؓ(f)避免I/OdQ一些应用采用了(jin)创徏大量U程的办法(在较好的情况下,?x)用一个缓冲池Q。这U技术可以在许多必须支持q发I/O的应用中见 刎ͼ如Web服务器、报价和拍卖应用{。然而,创徏JavaU程需要相当可观的开销?</p> <p>    JDK 1.4引入?jin)非d的I/O库(java.nioQ。如果应用要求用版本较早的JDKQ在q里有一个支持非dI/O的Y件包?/p> <p> </p> <p><strong>8.不要重复初始化变?/strong> <strong> </strong></p> <p><strong>      </strong>■默认情况下Q调用类的构造函数时Q?Java?x)把变量初始化成定的|(x)所有的对象被设|成nullQ整数变量(byte、short、int、longQ设|成0Qfloat?double变量讄?.0Q逻辑D|成false?/p> <p>      当一个类从另一个类zӞq一点尤其应该注意,因ؓ(f)用new关键词创Z个对象时Q构造函数链中的所有构造函数都?x)被自动调用?/p> <p> </p> <p><strong>9.量指定cȝfinal修饰W?/strong> <strong> </strong></p> <p><strong>       </strong>■带有final修饰W的cL不可z的。在Java核心(j)API中,有许多应用final的例子,例如java.lang.String。ؓ(f)StringcL定final防止?jin)h们覆盖length()Ҏ(gu)?</p> <p>   另外Q如果指定一个类为finalQ则该类所有的Ҏ(gu)都是final。Java~译器会(x)LZ(x)内联QinlineQ所有的finalҎ(gu)Q这和具体的~译器实现有养I(j)。此举能够性能q_提高50%?/p> <p> </p> <p><strong>10.量使用局部变?/strong> <strong> </strong></p> <p><strong>       </strong>■调用方法时传递的参数以及(qing)在调用中创徏的(f)时变量都保存在栈QStackQ中Q速度较快。其他变量,如静(rn)态变量、实例变量等Q都在堆QHeapQ中创徏Q速度较慢。另外,依赖于具体的~译?JVMQ局部变量还可能得到q一步优化。请参见《尽可能使用堆栈变量》?/p> <p> </p> <p><strong>11.乘法和除?/strong> <strong> </strong></p> <p><strong>       </strong>■考虑下面的代?</p> <div id="wmqeeuq" class="dp-highlighter"> <div id="wmqeeuq" class="bar"> </div> <ol class="dp-j"> <li><span><span id="wmqeeuq" class="keyword">for</span><span> (val = </span><span id="wmqeeuq" class="number">0</span><span>; val < </span><span id="wmqeeuq" class="number">100000</span><span>; val +=</span><span id="wmqeeuq" class="number">5</span><span>) { alterX = val * </span><span id="wmqeeuq" class="number">8</span><span>; myResult = val * </span><span id="wmqeeuq" class="number">2</span><span>; }   </span></span> </li> </ol> </div> <pre class="java" style="display: none;" name="code">for (val = 0; val < 100000; val +=5) { alterX = val * 8; myResult = val * 2; } </pre> <p>        优化后:(x)</p> <div id="wmqeeuq" class="dp-highlighter"> <div id="wmqeeuq" class="bar"> </div> <ol class="dp-j"> <li><span><span id="wmqeeuq" class="keyword">for</span><span> (val = </span><span id="wmqeeuq" class="number">0</span><span>; val < </span><span id="wmqeeuq" class="number">100000</span><span>; val += </span><span id="wmqeeuq" class="number">5</span><span>) { alterX = val << </span><span id="wmqeeuq" class="number">3</span><span>; myResult = val << </span><span id="wmqeeuq" class="number">1</span><span>; }   </span></span> </li> </ol> </div> <pre class="java" style="display: none;" name="code">for (val = 0; val < 100000; val += 5) { alterX = val << 3; myResult = val << 1; } </pre> <p> </p>        修改后的代码不再做乘?sh)?的操作,而是改用{h(hun)的左U?位操作,每左U?位相当于乘(sh)2。相应地Q右U?位操作相当于除以2。值得一提的是,虽然UM操作速度快,但可能代码比较难于理解Q所以最好加上一些注释?nbsp; <img src ="http://www.aygfsteel.com/huanghuizz/aggbug/255909.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/huanghuizz/" target="_blank">七匹?/a> 2009-02-20 23:58 <a href="http://www.aygfsteel.com/huanghuizz/articles/255909.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>多反向代理下获取客L(fng)真实IP地址 http://www.aygfsteel.com/huanghuizz/articles/188234.html七匹?/dc:creator>七匹?/author>Mon, 24 Mar 2008 06:23:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/188234.htmlhttp://www.aygfsteel.com/huanghuizz/comments/188234.htmlhttp://www.aygfsteel.com/huanghuizz/articles/188234.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/188234.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/188234.html
q段旉在做IPl计的程序设计,׃服务器作?jin)集,使用了(jin)反向代理YӞhttp://192.168.1.110:2046/? URL反向代理为http://www.xxx.com/的URLӞ用request.getRemoteAddr()Ҏ(gu)获取的IP地址是:(x) 127.0.0.1 或 192.168.1.110Q而ƈ不是客户端的真实QP。这是什么原因呢Q?

q是反向代理的原因。经q代理以后,׃在客L(fng)和服务之间增加了(jin)中间层,因此服务器无法直接拿到客L(fng)的IPQ服务器端应用也无法直接通过 转发h的地址q回l客L(fng)。但是在转发h的HTTP头信息中Q增加了(jin)XQFORWARDEDQFOR信息。用以跟t原有的客户端IP地址和原来客L(fng) h的服务器地址。当我们讉Khttp://www.xxx.com/index.jsp/Ӟ其实q不是我们浏览器真正讉KC(jin)服务器上? index.jsp文gQ而是先由代理服务器去讉Khttp://192.168.1.110:2046/index.jspQ代理服务器再将讉K到的l? 果返回给我们的浏览器Q因为是代理服务器去讉Kindex.jsp的,所以index.jsp中通过request.getRemoteAddr()的方 法获取的IP实际上是代理服务器的地址Qƈ不是客户端的IP地址?

于是可得?gu)得客L(fng)真实IP地址的方法一Q?

1 public String getIpAddr(HttpServletRequest request) {
2 String ip = request.getHeader("x-forwarded-for");
3 if(ip == null || ip.length() == 0) {
4 ip = request.getRemoteAddr();
5 }
6 return ip;
7 }
可是当我讉Khttp://www.xxx.com/index.jsp/Ӟq回的IP地址始终是unknownQ也q不是如上所C的 127.0.0.1 或 192.168.1.110?jin),而我讉Khttp://192.168.1.110:2046/index.jspӞ则能q回 客户端的真实IP地址Q写?jin)个?gu)去验证?

1<%@ page import="java.util.*" %>
2<table border=1 cellspacing=0 cellpadding=0 align=center>
3<tr>
4<th>Name</th>
5<th>Value</th>
6</tr>
7<%
8Enumeration enumNames;
9String strName,strValue;
10
11enumNames = request.getHeaderNames();
12while(enumNames.hasMoreElements()){
13 strName = (String)enumNames.nextElement();
14 strValue = request.getHeader(strName);
15 %>
16 <tr>
17 <td><%=strName%></td>
18 <td><%=strValue%></td>
19 </tr>
20 <%
21}
22%>
23<tr>
24</table>
25

出来的结果:(x)X-Forwarded-For: unknown 。X-Forwarded-For实存在Q但其值却为unknownQ(h)l找原因。上|搜?jin)搜Q原因出在了(jin)Squid上?

squid.conf 的配制文件 forwarded_for w认是为onQ如?forwarded_for 设成?off  则:(x)

X-Forwarded-For: unknown

一查,发现forwarded_for 设Z(jin)offQ原因找C(jin)Q把forwarded_for 设Z(jin)onQ重启后Q访问http://www.xxx.com/index.jsp/ 获得的IP是客L(fng)的真实IP?

于是可得?gu)得客L(fng)真实IP地址的方法二Q?

1 public String getIpAddr(HttpServletRequest request) {
2 String ip = request.getHeader("x-forwarded-for");
3 if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
4 ip = request.getHeader("Proxy-Client-IP");
5 }
6 if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
7 ip = request.getHeader("WL-Proxy-Client-IP");
8 }
9 if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
10 ip = request.getRemoteAddr();
11 }
12 return ip;
13 }
14


可是Q如果通过?jin)多U反向代理的话,X-Forwarded-For的值ƈ不止一个,而是一Ԍp|I竟哪个才是真正的用L(fng)的真实IP呢?

{案是取X-Forwarded-For中第一个非unknown的有效IP字符丌Ӏ?

如:(x)
X-Forwarded-ForQ?92.168.1.110, 192.168.1.120, 192.168.1.130, 192.168.1.100
用户真实IP为:(x) 192.168.1.110

引用Qhttp://zhangljerry.javaeye.com/blog/91638


]]>
Log4J 最?jng)_践之全能配置文ghttp://www.aygfsteel.com/huanghuizz/articles/188147.html七匹?/dc:creator>七匹?/author>Mon, 24 Mar 2008 01:52:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/188147.htmlhttp://www.aygfsteel.com/huanghuizz/comments/188147.htmlhttp://www.aygfsteel.com/huanghuizz/articles/188147.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/188147.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/188147.html
log4j.rootLogger=DEBUG,CONSOLE,A1,im
#DEBUG,CONSOLE,FILE,ROLLING_FILE,MAIL,DATABASE

log4j.addivity.org.apache=true


###################
# Console Appender
###################
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.Threshold=DEBUG
log4j.appender.CONSOLE.Target=System.out
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
#log4j.appender.CONSOLE.layout.ConversionPattern=[start]%d{DATE}[DATE]%n%p[PRIORITY]%n%x[NDC]%n%t[THREAD] n%c[CATEGORY]%n%m[MESSAGE]%n%n


#####################
# File Appender
#####################
log4j.appender.FILE=org.apache.log4j.FileAppender
log4j.appender.FILE.File=file.log
log4j.appender.FILE.Append=false
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n
# Use this layout for LogFactor 5 analysis



########################
# Rolling File
########################
log4j.appender.ROLLING_FILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLING_FILE.Threshold=ERROR
log4j.appender.ROLLING_FILE.File=rolling.log
log4j.appender.ROLLING_FILE.Append=true
log4j.appender.ROLLING_FILE.MaxFileSize=10KB
log4j.appender.ROLLING_FILE.MaxBackupIndex=1
log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.ROLLING_FILE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n


####################
# Socket Appender
####################
log4j.appender.SOCKET=org.apache.log4j.RollingFileAppender
log4j.appender.SOCKET.RemoteHost=localhost
log4j.appender.SOCKET.Port=5001
log4j.appender.SOCKET.LocationInfo=true
# Set up for Log Facter 5
log4j.appender.SOCKET.layout=org.apache.log4j.PatternLayout
log4j.appender.SOCET.layout.ConversionPattern=[start]%d{DATE}[DATE]%n%p[PRIORITY]%n%x[NDC]%n%t[THREAD]%n%c[CATEGORY]%n%m[MESSAGE]%n%n


########################
# Log Factor 5 Appender
########################
log4j.appender.LF5_APPENDER=org.apache.log4j.lf5.LF5Appender
log4j.appender.LF5_APPENDER.MaxNumberOfRecords=2000


########################
# SMTP Appender
#######################
log4j.appender.MAIL=org.apache.log4j.net.SMTPAppender
log4j.appender.MAIL.Threshold=FATAL
log4j.appender.MAIL.BufferSize=10
log4j.appender.MAIL.From=chenyl@hollycrm.com
log4j.appender.MAIL.SMTPHost=mail.hollycrm.com
log4j.appender.MAIL.Subject=Log4J Message
log4j.appender.MAIL.To=chenyl@hollycrm.com
log4j.appender.MAIL.layout=org.apache.log4j.PatternLayout
log4j.appender.MAIL.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n


########################
# JDBC Appender
#######################
log4j.appender.DATABASE=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.DATABASE.URL=jdbc:mysql://localhost:3306/test
log4j.appender.DATABASE.driver=com.mysql.jdbc.Driver
log4j.appender.DATABASE.user=root
log4j.appender.DATABASE.password=
log4j.appender.DATABASE.sql=INSERT INTO LOG4J (Message) VALUES ('[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n')
log4j.appender.DATABASE.layout=org.apache.log4j.PatternLayout
log4j.appender.DATABASE.layout.ConversionPattern=[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n


log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File=SampleMessages.log4j
log4j.appender.A1.DatePattern=yyyyMMdd-HH'.log4j'
log4j.appender.A1.layout=org.apache.log4j.xml.XMLLayout

###################
#自定义Appender
###################
log4j.appender.im = net.cybercorlin.util.logger.appender.IMAppender

log4j.appender.im.host = mail.cybercorlin.net
log4j.appender.im.username = username
log4j.appender.im.password = password
log4j.appender.im.recipient = corlin@cybercorlin.net

log4j.appender.im.layout=org.apache.log4j.PatternLayout
log4j.appender.im.layout.ConversionPattern =[framework] %d - %c -%-4r [%t] %-5p %c %x - %m%n

引用 Qhttp://www.dingl.com/view.shtml?xh=485


]]>
amcharts漂亮报表 破解http://www.aygfsteel.com/huanghuizz/articles/181919.html七匹?/dc:creator>七匹?/author>Mon, 25 Feb 2008 02:48:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/181919.htmlhttp://www.aygfsteel.com/huanghuizz/comments/181919.htmlhttp://www.aygfsteel.com/huanghuizz/articles/181919.html#Feedback1http://www.aygfsteel.com/huanghuizz/comments/commentRss/181919.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/181919.htmlamcharts漂亮报表
http://www.amcharts.com/download

破解Ҏ(gu)Q?
今天介绍破解amcharts的方法一Q从swf文g入手?
用SWF Decompiler软g加蝲swf文gQ在Resources下找Action中的MainMoiveQ代码中有一D如下:(x)
function checkKey(serial)
{
var _l1 = com.amcharts.Utils.stripSymbols(serial, " ");
_l1 = com.amcharts.Utils.stripSymbols(_l1, "\n");
_l1 = com.amcharts.Utils.stripSymbols(_l1, "\r");
_l1 = com.amcharts.Utils.stripSymbols(_l1, "\r\n");
arr = _l1.split("-");
if (Number(arr[2]) + Number(arr[3]) != 8645 || Number(arr[2].substr(1, 1)) - Number(arr[3].substr(2, 1)) != 2)
{
attachMovie("copyright_mc", "copyright_mc", 1001);
} // end if
} // End of the function
q就是序列号的代码,再往下看
key_loader.loadVars(path + "amcharts_key.txt", this, "checkKey", false, "checkKey");
到这里,学过一点基~程的都看明白了(jin)?
? -"作ؓ(f)序列L(fng)链接W号Q第二个链接W号后的?W三个符号后的数=8645Qƈ且第二个链接W号后的C的第一位数后面的一位数-W三个符号后的数中的W二位数后面的一位数=2Q只要满三个条g的序列号可以了(jin)Q然后把q个序列号保存在swf文g相同文g夹下?span class="hilite1">amcharts_key.txt 中,看来作者的注册方式极ؓ(f)单~
下蝲以下序列hӞ解压到swf文g的目?

]]>
Java2 q算W?/title><link>http://www.aygfsteel.com/huanghuizz/articles/163954.html</link><dc:creator>七匹?/dc:creator><author>七匹?/author><pubDate>Thu, 29 Nov 2007 03:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/huanghuizz/articles/163954.html</guid><wfw:comment>http://www.aygfsteel.com/huanghuizz/comments/163954.html</wfw:comment><comments>http://www.aygfsteel.com/huanghuizz/articles/163954.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/huanghuizz/comments/commentRss/163954.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/huanghuizz/services/trackbacks/163954.html</trackback:ping><description><![CDATA[<p style="text-indent: 2em">?-7 Java q算W优先 <p style="text-indent: 2em">最? <p style="text-indent: 2em">( ) [ ] . <p style="text-indent: 2em">++ – – ~ ! <p style="text-indent: 2em">* / % <p style="text-indent: 2em">+ – <p style="text-indent: 2em">>> >>> << <p style="text-indent: 2em">> >= < <= <p style="text-indent: 2em">l表 <p style="text-indent: 2em">== != <p style="text-indent: 2em">& <p style="text-indent: 2em">^ <p style="text-indent: 2em">| <p style="text-indent: 2em">&& <p style="text-indent: 2em">|| <p style="text-indent: 2em">?: <p style="text-indent: 2em">= op= <p style="text-indent: 2em">最?</p> <img src ="http://www.aygfsteel.com/huanghuizz/aggbug/163954.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/huanghuizz/" target="_blank">七匹?/a> 2007-11-29 11:35 <a href="http://www.aygfsteel.com/huanghuizz/articles/163954.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>学习(fn)使用 Manifesthttp://www.aygfsteel.com/huanghuizz/articles/163379.html七匹?/dc:creator>七匹?/author>Tue, 27 Nov 2007 01:30:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/163379.htmlhttp://www.aygfsteel.com/huanghuizz/comments/163379.htmlhttp://www.aygfsteel.com/huanghuizz/articles/163379.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/163379.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/163379.html 发布Java应用E序时你?x)感到困难?好在Java提供?jin)一pd打包和发布工P可以显著的简化发布过E?
该文章提供了(jin)打包Java code的几U方法,我们会(x)探讨Java manifest 文gQ给出用于管理JAR文g所依赖文g、估计跨q_发布所需的CLasspath的合适方?我也?x)解释如何用manifest包版本特性来认包的兼容?..

什么是JAR文gQ?

在开发过E中Q我们可以直接用Java class文g来运行程序,但这q不是一个好方式Q好在Java 提供?JAR(Java Archive)文g来提供发布和q行?

jar 文g实际上是class 文g的ZIP压羃存档Q这U格式被q泛使用Q因此易与用,有很多中工具可以操作q种格式的文件。也正是因ؓ(f)q个原因Qjar文g本nq不能表达所包含应用E序的标{信息?

Manifest 因此得以出现

Z(jin)要提供存档的标签信息Qjar 文g指定?jin)一个特定目录来存放标签信息QMETA-INF 目录Q其中我们来x(chng)该目录中的MANIFEST.MF文gQ他是JAR的manifest文gQ他包含?jin)JAR文g的内Ҏ(gu)qͼq在q行时向JVM提供应用E序的信息,大多数JAR文g含有一个默认生成的manifest 文g,执行JAR命o(h)或用zip工具Q都可以产生?

如果是由jar命o(h)产生?manifest 文gQŞ?

Manifest-Version: 1.0
Created-By:1.4.0-beta
(Sun Microsystems Inc.)

q些信息没甚么用,仅仅告诉我们使用的是1.0的manifest文g,W一行定义manifest的格式,W二行说明?SUN 的JDK1.4的jar工具生成该文Ӟ如果manifest文g是由其他 Q如antQ?创徏的,那将?x)出?“Created-By: Ant 1.2” 之类的内容,如果你是自己创徏manifest文gQ你可以加入自己的一些相关信?

基础格式

manifest 文g的格?是很单的Q每一行都?名-?对应?属性名开_(d)接着?":" Q然后是属性|每行最?2个字W,如果需要增加,你可以在下一行箋(hu)行,l行以空格开_(d)以空格开头的行都?x)被视?f)前一行的l行?

所有在开头的属性都是全局的,你也可以定义特定class 或package的属性,E后介l这U?

把manifest文g插入JAR文g

使用 m 选项Q把指定文g名的manifest文g 传入Q例?

jar cvfm myapplication.jar myapplication.mf -C classdir

如果你用ant来创建时Q在ant 的build.xml 加入如下条目

<target name="jar">
<jar jarfile ="myapplication.jar"
manifest="myapplication.mf">
<fileset dir="classdir"
includes="**/*.class"/>
</jar>
</target>

q行JavaE序

现在我们来体验一下manifest文g的作用,如果现在我们有一个Java 应用E序打包在myapplication.jar中, main class?com.example.myapp.MyAppMain Q那么我们可以用以下的命令来q行

java -classpath myapplication.jar com.example.myapp.MyAppMain

q显然太ȝ(ch)?jin),现在我们来创qmanifest文gQ如下:(x)

Manifest-Version: 1.0
Created-By: JDJ example
Main-Class: com.example.myapp.MyAppMain

q样我们可以用如下的命o(h)来运行程序了(jin)Q(明显单多?jin),也不会(x)造成无谓的拼写错误)(j)

java -jar myapplication.jar

理JAR的依赖资?

很少Java应用?x)仅仅只有一个jar文gQ一般还需?其他cd。比如我的应用程序用C(jin)Sun ?Javamail classes Q在classpath中我需要包含activation.jar ?mail.jar,q样在运行程序时,相比上面的例?我们要增加一?

java -classpath mail.jar:activation.jar -jar myapplication.jar

在不同的操作pȝ?jar包间的分隔符也不一P在UNIX?#8220;Q?#8221;Q在window中?“Q?#8221;Q这样也不方?

同样Q我们改写我们的manifest文gQ如?

Manifest-Version: 1.0
Created-By: JDJ example
Main-Class: com.example.myapp.MyAppMain
Class-Path: mail.jar activation.jar

Q加入了(jin)Class-Path: mail.jar activation.jarQ用I格分隔两个jar包)(j)

q样我们仍然可以使用和上例中相同的命令来执行该程序:(x)

java -jar myapplication.jar

Class-Path属性中包含?jin)用I格分隔的jar文gQ在q些jar文g名中要对特定的字W用逃逸符Q比如空|要表C成"%20"Q在路径的表CZQ都采用“/”来分隔目录,无论是在什么操作系l中Q?即在window?Q而且q里用的是相对\径(相对于本w的JAR文gQ:(x)

Manifest-Version: 1.0
Created-By: JDJ example
Main-Class: com.example.myapp.MyAppMain
Class-Path: ext/mail.jar ext/activation.jar


Multiple Main ClassesQ多ȝQ?
q有一UMultiple Main Classes情况Q如果你的应用程序可能有命o(h)行版?和GUI版本Q或者一些不同的应用却共享很多相同的代码Q这时你可能有多个Main ClassQ我们徏议你采取q样的策略:(x)把共享的cL成lib包,然后把不同的应用打成不同的包Q分别标志主c:(x)如下


Manifest for myapplicationlib.jar:
Manifest-Version: 1.0
Created-By: JDJ example
Class-Path: mail.jar activation.jar

Manifest for myappconsole.jar:
Manifest-Version: 1.0
Created-By: JDJ example
Class-Path: myapplicationlib.jar
Main-Class: com.example.myapp.MyAppMain

Manifest for myappadmin.jar:
Manifest-Version: 1.0
Created-By: JDJ example
Class-Path: myapplicationlib.jar
Main-Class: com.example.myapp.MyAdminTool


在myappconsole.jar ?myappadmin.jar的manifest文g中分别注明各自的 Main Class


Package Versioning

完成发布后,如果使用者想?jin)?Q哪些代码是谁的Q目前是什么版本?使用什么版本的cdQ解决的Ҏ(gu)很多 Qmanifest提供?jin)一个较好的Ҏ(gu)Q你可以在manifest文g中描q每一个包的信息?

Java U承?jin)实现说明与描述分离的原则,package 的描q?定义?jin)package 是什么,实现说明 定义?jin)谁提供了(jin)描q的实现Q描q和实现包含 名、版本号和提供者。要得到q些信息Q可以查看JVM的系l属性(使用 java.lang.System.getProperty() Q?


在manifest文g中,我可以ؓ(f)每个package定义描述和实现版本,声明名字Qƈ加入描述属性和实现属性,q些属性是

Specification-Title
Specification-Version
Specification-Vendor
Implementation-Title
Implementation-Version
Implementation-Vendor

当要提供一个类库或~程接口Ӟ描述信息昑־是很重要Q见以下范例Q?

Manifest-Version: 1.0
Created-By: JDJ example
Class-Path: mail.jar activation.jar

Name: com/example/myapp/
Specification-Title: MyApp
Specification-Version: 2.4
Specification-Vendor: example.com
Implementation-Title: com.example.myapp
Implementation-Version: 2002-03-05-A
Implementation-Vendor: example.com


Package Version 查询
在manifest文g中加入package描述后,可以用Java提供的java.lang.Package classq行Package 的信息查询,q里列D3个最基本的获取package object的方?

1.Package.getPackages():q回pȝ中所有定义的package列表
2.Package.getPackage(String packagename):按名q回package
3.Class.getPackage():q回l定class所在的package

使用者这Ҏ(gu)可以动态的获取package信息.
需要注意的是如果给定的package中没有class被加?则也无法获得package 对象

Manifest 技?
L以Manifest-Version属性开?

每行最?2个字W,如果过的化Q采用箋(hu)?

认每行都以回Rl束Q否则改行将?x)被忽?

如果Class-Path 中的存在路径Q?/"分隔目录Q与q_无关

使用I分隔d性和package属?

使用"/"而不?."来分隔package 和class ,比如 com/example/myapp/

class 要以.classl尾Qpackage 要以 / l尾

mag.javadigest.net ~译 英文原文

译 yife

引用Qhttp://www.jdon.com/jivejdon/forum/messageList.shtml?thread=15361&message=6994399


]]>
应用displaytag1.1 完成大数据量分页昄的例?/title><link>http://www.aygfsteel.com/huanghuizz/articles/78335.html</link><dc:creator>七匹?/dc:creator><author>七匹?/author><pubDate>Tue, 31 Oct 2006 09:53:00 GMT</pubDate><guid>http://www.aygfsteel.com/huanghuizz/articles/78335.html</guid><wfw:comment>http://www.aygfsteel.com/huanghuizz/comments/78335.html</wfw:comment><comments>http://www.aygfsteel.com/huanghuizz/articles/78335.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/huanghuizz/comments/commentRss/78335.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/huanghuizz/services/trackbacks/78335.html</trackback:ping><description><![CDATA[ <p>应用displaytag在struts中完成大数据量分|C,Oracle数据?/p> <p> (tng)</p> <p>JSP文gQ?/p> <p> (tng)</p> <div style="border: 0.5pt solid windowtext; padding: 4px 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 95%;"> <div> <img id="_2_54_Open_Image" onclick="this.style.display='none'; document.getElementById('_2_54_Open_Text').style.display='none'; document.getElementById('_2_54_Closed_Image').style.display='inline'; document.getElementById('_2_54_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="_2_54_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_2_54_Closed_Text').style.display='none'; document.getElementById('_2_54_Open_Image').style.display='inline'; document.getElementById('_2_54_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" /> <span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 0);"><%</span> <span id="_2_54_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">...</span> <span id="_2_54_Open_Text"> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">@ (tng)taglib (tng)uri</span> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">/WEB-INF/displaytag.tld</span> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> (tng)prefix</span> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">disp</span> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span> <span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> (tng)</span> </span> <span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 0);">%></span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> </span> <span style="color: rgb(0, 0, 255);"><</span> <span style="color: rgb(128, 0, 0);">disp:table (tng)</span> <span style="color: rgb(255, 0, 0);">name</span> <span style="color: rgb(0, 0, 255);">="resultList"</span> <span style="color: rgb(255, 0, 0);"> (tng)export</span> <span style="color: rgb(0, 0, 255);">="true"</span> <span style="color: rgb(255, 0, 0);"> (tng)pagesize</span> <span style="color: rgb(0, 0, 255);">="100"</span> <span style="color: rgb(255, 0, 0);"> (tng)requestURI</span> <span style="color: rgb(0, 0, 255);">="logQueryAction.do"</span> <span style="color: rgb(255, 0, 0);"> (tng)sort</span> <span style="color: rgb(0, 0, 255);">="external"</span> <span style="color: rgb(255, 0, 0);"> (tng)id</span> <span style="color: rgb(0, 0, 255);">="element"</span> <span style="color: rgb(255, 0, 0);"> (tng)partialList</span> <span style="color: rgb(0, 0, 255);">="true"</span> <span style="color: rgb(255, 0, 0);"> (tng)size</span> <span style="color: rgb(0, 0, 255);">="resultSize"</span> <span style="color: rgb(0, 0, 255);">></span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);"><</span> <span style="color: rgb(128, 0, 0);">disp:column (tng)</span> <span style="color: rgb(255, 0, 0);">property</span> <span style="color: rgb(0, 0, 255);">="operdate"</span> <span style="color: rgb(255, 0, 0);"> (tng)title</span> <span style="color: rgb(0, 0, 255);">="操作旉"</span> <span style="color: rgb(255, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 255);">></</span> <span style="color: rgb(128, 0, 0);">disp:column</span> <span style="color: rgb(0, 0, 255);">></span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);"><</span> <span style="color: rgb(128, 0, 0);">disp:column (tng)</span> <span style="color: rgb(255, 0, 0);">property</span> <span style="color: rgb(0, 0, 255);">="pername"</span> <span style="color: rgb(255, 0, 0);"> (tng)title</span> <span style="color: rgb(0, 0, 255);">="操作人员"</span> <span style="color: rgb(255, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 255);">></</span> <span style="color: rgb(128, 0, 0);">disp:column</span> <span style="color: rgb(0, 0, 255);">></span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);"><</span> <span style="color: rgb(128, 0, 0);">disp:column (tng)</span> <span style="color: rgb(255, 0, 0);">property</span> <span style="color: rgb(0, 0, 255);">="opertype"</span> <span style="color: rgb(255, 0, 0);"> (tng)title</span> <span style="color: rgb(0, 0, 255);">="操作cd"</span> <span style="color: rgb(255, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 255);">></</span> <span style="color: rgb(128, 0, 0);">disp:column</span> <span style="color: rgb(0, 0, 255);">></span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> </span> <span style="color: rgb(0, 0, 255);"></</span> <span style="color: rgb(128, 0, 0);">disp:table</span> <span style="color: rgb(0, 0, 255);">></span> <span style="color: rgb(0, 0, 0);"> (tng)<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /></span> </div> </div> <p> (tng)</p> <p>name="resultList" 记录集存在session或者request中的键?br />export="true" 是否昄导出选项<br />pagesize="100" 每页昄100条数?br />requestURI="logQueryAction.do" (tng) struts中action的名Uͼ如果记录,可以直接分页<br />sort="external" (tng) 外部排序<br />id="element" (tng) (tng) 表格id|用于E序得相关的参数<br />partialList="true" (tng) 分段从数据库中读数据<br />size="resultSize" (tng) 记录的L敎ͼ用于计算总页?/p> <p> (tng)</p> <p>struts action:</p> <p> (tng)</p> <div style="border: 0.5pt solid windowtext; padding: 4px 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 95%;"> <div> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> <span style="color: rgb(0, 0, 0);">String (tng)pageIndexName (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 0);"> (tng)org.displaytag.util.ParamEncoder(</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">element</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">).encodeParameterName(org.displaytag.tags.TableTagParameters.PARAMETER_PAGE); (tng) (tng) // |的参数名<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">int</span> <span style="color: rgb(0, 0, 0);"> (tng)pageSize (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">100</span> <span style="color: rgb(0, 0, 0);">; (tng) (tng) //每页昄的条?br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">int</span> <span style="color: rgb(0, 0, 0);"> (tng)pageIndex (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)GenericValidator.isBlankOrNull(request.getParameter(pageIndexName))</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);">:(Integer.parseInt(request.getParameter(pageIndexName)) (tng)</span> <span style="color: rgb(0, 0, 0);">-</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">1</span> <span style="color: rgb(0, 0, 0);">); (tng) //当前|<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />String (tng)sqlCount (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">select (tng)count(*) (tng) (tng)from (tng)user_log (tng)a (tng)</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">; (tng) //用于l计总记录数的sql语句<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)String (tng)sql (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)select (tng)* (tng)from (tng)(select (tng)rownum (tng)as (tng)rid, (tng)t1.* (tng)from (tng)(select (tng)b.pername (tng)as (tng)pername,to_char(a.operdate,'yyyy-mm-dd (tng)hh24:mi:ss') (tng)as (tng)operdate,</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)decode(a.opertype,'D','删除','M','修改','其他') (tng)as (tng)opertype, (tng)a.hphm (tng)as (tng)hphm (tng)from (tng)user_log (tng)a, (tng)</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)(select (tng)asuser.userid (tng)as (tng)userid,nvl(asempmsg.pername,asuser.loginname) (tng)as (tng)pername (tng)from (tng)asuser,ASEMPMSG (tng)where (tng)asuser.perid=ASEMPMSG.perid(+)) (tng)b</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)where (tng)a.userid=b.userid (tng)</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">; (tng) (tng) (tng)//查询语句</span> </div> <div> <span style="color: rgb(0, 0, 0);"> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) //构造查询条?br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)StringBuffer (tng)sb (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 0);"> (tng)StringBuffer();<br /><img id="_930_1025_Open_Image" onclick="this.style.display='none'; document.getElementById('_930_1025_Open_Text').style.display='none'; document.getElementById('_930_1025_Closed_Image').style.display='inline'; document.getElementById('_930_1025_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="_930_1025_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_930_1025_Closed_Text').style.display='none'; document.getElementById('_930_1025_Open_Image').style.display='inline'; document.getElementById('_930_1025_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">if</span> <span style="color: rgb(0, 0, 0);">(logQueryForm.getCzrqStart()</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);"> (tng)</span> <span style="color: rgb(0, 0, 0);">&&</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">!</span> <span style="color: rgb(0, 0, 0);">""</span> <span style="color: rgb(0, 0, 0);">.equals(logQueryForm.getCzrqStart()))</span> <span id="_930_1025_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">...</span> <span id="_930_1025_Open_Text"> <span style="color: rgb(0, 0, 0);">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)sb.append(</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)and (tng)a.operdate (tng)> (tng)to_date('</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">logQueryForm.getCzrqStart()</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">','yyyy-mm-dd')</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)}</span> </span> <span style="color: rgb(0, 0, 0);"> <br /> <img id="_1105_1199_Open_Image" onclick="this.style.display='none'; document.getElementById('_1105_1199_Open_Text').style.display='none'; document.getElementById('_1105_1199_Closed_Image').style.display='inline'; document.getElementById('_1105_1199_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="_1105_1199_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_1105_1199_Closed_Text').style.display='none'; document.getElementById('_1105_1199_Open_Image').style.display='inline'; document.getElementById('_1105_1199_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">if</span> <span style="color: rgb(0, 0, 0);">(logQueryForm.getCzrqEnd()</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);"> (tng)</span> <span style="color: rgb(0, 0, 0);">&&</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">!</span> <span style="color: rgb(0, 0, 0);">""</span> <span style="color: rgb(0, 0, 0);">.equals(logQueryForm.getCzrqEnd()))</span> <span id="_1105_1199_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">...</span> <span id="_1105_1199_Open_Text"> <span style="color: rgb(0, 0, 0);">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)sb.append(</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)and (tng)a.operdate (tng)<= (tng)to_date('</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">logQueryForm.getCzrqEnd()</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">','yyyy-mm-dd')</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)}</span> </span> <span style="color: rgb(0, 0, 0);"> <br /> <img id="_1273_1341_Open_Image" onclick="this.style.display='none'; document.getElementById('_1273_1341_Open_Text').style.display='none'; document.getElementById('_1273_1341_Closed_Image').style.display='inline'; document.getElementById('_1273_1341_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="_1273_1341_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_1273_1341_Closed_Text').style.display='none'; document.getElementById('_1273_1341_Open_Image').style.display='inline'; document.getElementById('_1273_1341_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">if</span> <span style="color: rgb(0, 0, 0);">(logQueryForm.getCzlx()</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);"> (tng)</span> <span style="color: rgb(0, 0, 0);">&&</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">!</span> <span style="color: rgb(0, 0, 0);">""</span> <span style="color: rgb(0, 0, 0);">.equals(logQueryForm.getCzlx()))</span> <span id="_1273_1341_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">...</span> <span id="_1273_1341_Open_Text"> <span style="color: rgb(0, 0, 0);">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)sb.append(</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)and (tng)a.opertype (tng)= (tng)'</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">logQueryForm.getCzlx()</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">'</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)}</span> </span> <span style="color: rgb(0, 0, 0);"> <br /> <img id="_1415_1481_Open_Image" onclick="this.style.display='none'; document.getElementById('_1415_1481_Open_Text').style.display='none'; document.getElementById('_1415_1481_Closed_Image').style.display='inline'; document.getElementById('_1415_1481_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="_1415_1481_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_1415_1481_Closed_Text').style.display='none'; document.getElementById('_1415_1481_Open_Image').style.display='inline'; document.getElementById('_1415_1481_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">if</span> <span style="color: rgb(0, 0, 0);">(logQueryForm.getCzry()</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);"> (tng)</span> <span style="color: rgb(0, 0, 0);">&&</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">!</span> <span style="color: rgb(0, 0, 0);">""</span> <span style="color: rgb(0, 0, 0);">.equals(logQueryForm.getCzry()))</span> <span id="_1415_1481_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">...</span> <span id="_1415_1481_Open_Text"> <span style="color: rgb(0, 0, 0);">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)sb.append(</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)and (tng)a.userid (tng)= (tng)'</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">logQueryForm.getCzry()</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">'</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">);<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)}</span> </span> <span style="color: rgb(0, 0, 0);"> <br /> <img id="_1555_1624_Open_Image" onclick="this.style.display='none'; document.getElementById('_1555_1624_Open_Text').style.display='none'; document.getElementById('_1555_1624_Closed_Image').style.display='inline'; document.getElementById('_1555_1624_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="_1555_1624_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_1555_1624_Closed_Text').style.display='none'; document.getElementById('_1555_1624_Open_Image').style.display='inline'; document.getElementById('_1555_1624_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)sqlCount (tng)</span> <span style="color: rgb(0, 0, 0);">+=</span> <span style="color: rgb(0, 0, 0);"> (tng)sb.toString();<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)sql (tng)</span> <span style="color: rgb(0, 0, 0);">+=</span> <span style="color: rgb(0, 0, 0);"> (tng)sb.toString()</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)order (tng)by (tng)a.operdate (tng)desc) (tng)t1 (tng)where (tng)rownum<=</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);"> (tng)(pageIndex (tng)</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">1</span> <span style="color: rgb(0, 0, 0);">) (tng)</span> <span style="color: rgb(0, 0, 0);">*</span> <span style="color: rgb(0, 0, 0);"> (tng)pageSize (tng)</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);"> (tng)) (tng)t2 (tng)where (tng)t2.rid></span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">+</span> <span style="color: rgb(0, 0, 0);"> (tng)pageIndex (tng)</span> <span style="color: rgb(0, 0, 0);">*</span> <span style="color: rgb(0, 0, 0);"> (tng)pageSize; (tng) //分页d语句<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 128, 0);">//</span> <span style="color: rgb(0, 128, 0);">System.out.println(sb.toString());</span> <span style="color: rgb(0, 128, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> </span> <span style="color: rgb(0, 0, 0);"> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)DBBean (tng)db (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 255);">new</span> <span style="color: rgb(0, 0, 0);"> (tng)DBBean();<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)ResultSet (tng)rs (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 255);">null</span> <span style="color: rgb(0, 0, 0);">;<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)PreparedStatement (tng)prep (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)</span> <span style="color: rgb(0, 0, 255);">null</span> <span style="color: rgb(0, 0, 0);">;<br /><img id="_1938_2211_Open_Image" onclick="this.style.display='none'; document.getElementById('_1938_2211_Open_Text').style.display='none'; document.getElementById('_1938_2211_Closed_Image').style.display='inline'; document.getElementById('_1938_2211_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="_1938_2211_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_1938_2211_Closed_Text').style.display='none'; document.getElementById('_1938_2211_Open_Image').style.display='inline'; document.getElementById('_1938_2211_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">try</span> <span id="_1938_2211_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">...</span> <span id="_1938_2211_Open_Text"> <span style="color: rgb(0, 0, 0);">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)List (tng)resultList (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)db.getResultList(sql); (tng) (tng) //ResultSet保存在List里返?br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)request.setAttribute(</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">resultList</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">,resultList); (tng) //把结果存入request<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)prep (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)db.getConnection().prepareStatement(sqlCount); (tng) (tng) (tng) <br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)rs (tng)</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> (tng)prep.executeQuery();<br /><img id="_2136_2207_Open_Image" onclick="this.style.display='none'; document.getElementById('_2136_2207_Open_Text').style.display='none'; document.getElementById('_2136_2207_Closed_Image').style.display='inline'; document.getElementById('_2136_2207_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="_2136_2207_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_2136_2207_Closed_Text').style.display='none'; document.getElementById('_2136_2207_Open_Image').style.display='inline'; document.getElementById('_2136_2207_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">if</span> <span style="color: rgb(0, 0, 0);">(rs.next())</span> <span id="_2136_2207_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">...</span> <span id="_2136_2207_Open_Text"> <span style="color: rgb(0, 0, 0);">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)request.setAttribute(</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">resultSize</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);"> (tng)I(yng)nteger(rs.getInt(</span> <span style="color: rgb(0, 0, 0);">1</span> <span style="color: rgb(0, 0, 0);">))); (tng) (tng) (tng) (tng) //总记录数保存成Intger实例保存在request?br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)}</span> </span> <span style="color: rgb(0, 0, 0);"> <br /> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)}</span> </span> <span style="color: rgb(0, 0, 0);"> <br /> <img id="_2234_2263_Open_Image" onclick="this.style.display='none'; document.getElementById('_2234_2263_Open_Text').style.display='none'; document.getElementById('_2234_2263_Closed_Image').style.display='inline'; document.getElementById('_2234_2263_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="_2234_2263_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_2234_2263_Closed_Text').style.display='none'; document.getElementById('_2234_2263_Open_Image').style.display='inline'; document.getElementById('_2234_2263_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">catch</span> <span style="color: rgb(0, 0, 0);">(Exception (tng)ex)</span> <span id="_2234_2263_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">...</span> <span id="_2234_2263_Open_Text"> <span style="color: rgb(0, 0, 0);">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)ex.printStackTrace();<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)}</span> </span> <span style="color: rgb(0, 0, 0);"> <br /> <img id="_2274_2327_Open_Image" onclick="this.style.display='none'; document.getElementById('_2274_2327_Open_Text').style.display='none'; document.getElementById('_2274_2327_Closed_Image').style.display='inline'; document.getElementById('_2274_2327_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="_2274_2327_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_2274_2327_Closed_Text').style.display='none'; document.getElementById('_2274_2327_Open_Image').style.display='inline'; document.getElementById('_2274_2327_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">finally</span> <span id="_2274_2327_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">...</span> <span id="_2274_2327_Open_Text"> <span style="color: rgb(0, 0, 0);">{<br /><img id="_2291_2322_Open_Image" onclick="this.style.display='none'; document.getElementById('_2291_2322_Open_Text').style.display='none'; document.getElementById('_2291_2322_Closed_Image').style.display='inline'; document.getElementById('_2291_2322_Closed_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="_2291_2322_Closed_Image" style="display: none;" onclick="this.style.display='none'; document.getElementById('_2291_2322_Closed_Text').style.display='none'; document.getElementById('_2291_2322_Open_Image').style.display='inline'; document.getElementById('_2291_2322_Open_Text').style.display='inline';" alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)</span> <span style="color: rgb(0, 0, 255);">if</span> <span style="color: rgb(0, 0, 0);">(db</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 id="_2291_2322_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);">...</span> <span id="_2291_2322_Open_Text"> <span style="color: rgb(0, 0, 0);">{<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)db.closeConnection(); (tng) (tng) (tng) //关闭q接<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)}</span> </span> <span style="color: rgb(0, 0, 0);"> (tng)<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)}</span> </span> </div> </div> <p> (tng)</p> <p>其中的页面导航是英文的,只要修改org.displaytag.properties.TableTag.properties配置文g可以把英文Ҏ(gu)中文。同时还可以指定导出文g的类型以?qing)文件名?/p> <div style="border: 0.5pt solid windowtext; padding: 4px 5.4pt; background: rgb(230, 230, 230) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; width: 95%;"> <div> <img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" /> <span style="color: rgb(0, 0, 0);">export.excel</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">true<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />export.excel.label</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"><span (tng)class</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">export (tng)excel</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">>Excel (tng)</span><br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />export.excel.include_header</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">true<br /><img alt="" src="http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif" align="top" />export.excel.filename</span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">export.xls</span> </div> </div> <p>如果不指定文件名Q在点击导出excel的时候,׃(x)在ieH口中打开excel文g。很?ch)hQ?br />指定文g名后可以选择保存和打开?jin)?/p> <div align="center"> <script type="text/javascript"> <!--google_ad_client = "pub-9648238652058580";google_ad_width = 468;google_ad_height = 60;google_ad_format = "468x60_as_rimg";google_cpa_choice = "CAAQiYaYhAIaCJ2wcuQYTrQ_KOm293M";google_ad_channel = "";//--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <iframe name="google_ads_frame" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-9648238652058580&dt=1162260842406&lmt=1162260832&prev_fmts=125x125_as&format=180x60&output=html&url=http%3A%2F%2Fblog.csdn.net%2Flveyo%2Farchive%2F2006%2F08%2F16%2F1076047.aspx&ref=http%3A%2F%2Ftag.csdn.net%2FArticle%2Fabe762e2-9bc7-4287-8938-f3828bd1af68.html&cc=22&u_h=768&u_w=1024&u_ah=690&u_aw=1024&u_cd=32&u_tz=480&u_his=1&u_java=true&u_nplug=17&u_nmime=52" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" frameborder="0" height="60" scrolling="no" width="180"> </iframe> </div> <br /> <br /> <p id="TBPingURL">Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1076047</p> <img src ="http://www.aygfsteel.com/huanghuizz/aggbug/78335.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/huanghuizz/" target="_blank">七匹?/a> 2006-10-31 17:53 <a href="http://www.aygfsteel.com/huanghuizz/articles/78335.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在JSP中应用FCKeditorhttp://www.aygfsteel.com/huanghuizz/articles/77947.html七匹?/dc:creator>七匹?/author>Sun, 29 Oct 2006 16:16:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/77947.htmlhttp://www.aygfsteel.com/huanghuizz/comments/77947.htmlhttp://www.aygfsteel.com/huanghuizz/articles/77947.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/77947.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/77947.html1. FCKeditor2.1.1解压~到目的根目录下,目录l构为:(x)\目名\FCKeditor\ Q然后将FCKeditor-2.3.zipQjavaQ压~包中\web\WEB-INF\lib\目录下的两个jar文g拷到目的\WEB-INF\lib\目录下?/p>

2. FCKeditor-2.3.zip压羃包中\web\WEB-INF\目录下的web.xml文g合ƈ到项目的\WEB-INF\目录下的web.xml文g中?/p>

3. 修改合ƈ后的web.xml文gQ将名ؓ(f)SimpleUploader的Servlet的enabled参数值改为trueQ以允许上传功能QConnector Servlet的baseDir参数值用于设|上传文件存攄位置?/p>

4. 上面两个servlet的映分别ؓ(f)Q?editor/filemanager/browser/default/connectors/jsp/connector?editor/filemanager/upload/simpleuploaderQ因为我的FCKeditor是放到\目名\FCKeditor\目录下,所以需要在两个映射前面加上/FCKeditorQ即改ؓ(f)/FCKeditor/editor/filemanager/browser/default/connectors/jsp/connector?FCKeditor/editor/filemanager/upload/simpleuploader?/p>

5. 采用Taglib在jsp中添加如下代码创建在U编辑器Q?/p>

 (tng) (tng) (tng) 在页面的剙加入?@ taglib uri="http://fckeditor.net/tags-fckeditor" prefix="FCK" %?/p>

 (tng) (tng) (tng) 在适当的位|加入下面代?/p>

 (tng) (tng)〈F(tun)CK:editor id="infoContent" basePath="/CM/FCKeditor/"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)width="522"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)height="300"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)skinPath="/CM/FCKeditor/editor/skins/silver/"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)defaultLanguage="zh-cn"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)tabSpaces="8"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)toolbarSet="CM"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)imageBrowserURL="/CM/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)linkBrowserURL="/CM/FCKeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)flashBrowserURL="/CM/FCKeditor/editor/filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)imageUploadURL="/CM/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Image"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng)linkUploadURL="/CM/FCKeditor/editor/filemanager/upload/simpleuploader?Type=File"
 (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) flashUploadURL="/CM/FCKeditor/editor/filemanager/upload/simpleuploader?Type=Flash"?br /> (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) (tng) 误入内?br /> (tng) (tng)?FCK:editor?/fck:editor>

 (tng) (tng) (tng) 注意/CM/Qؓ(f)目名,不用修改web.xml文g?/p>

6. (tng)l过上面步骤可以在jsp中用FCKeditor?jin)?/p>

===================================================================

另外Q如果用WebLogicQ需要将FCKeditor-2.3.zip压羃包中src目录下的FCKeditor.tld文g提取出来Q比如将其放到WEB-INF/tlds/目录下,然后jsp中的taglib语句修改为如下所C,可以正怋用了(jin)Q?/p>

<%@ taglib uri="/WEB-INF/tlds/FCKeditor.tld" prefix="FCK" %>

三、配|?/b>

  FCKeditor 2.0的配|文件ؓ(f)FCKeditor\fckconfig.jsQ其中几个重要的配置目如下Q?br />
1、工h的设|?br />
  默认情况下,FCKeditor?x)调用如下的工具栏按钮,大家可以?gu)自己的需要进行增减。需要注意的是,2.0版与1.6版的按钮q不完全相同Q有些按钮以?qing)删除或者改名了(jin)?br />
//##
//## Toolbar Buttons Sets
//##
FCKConfig.ToolbarSets["Default"] = [
 (tng) (tng) (tng) (tng) (tng) (tng) ['Source','-','Save','NewPage','Preview'],
 (tng) (tng) (tng) (tng) (tng) (tng) ['Cut','Copy','Paste','PasteText','PasteWord','-','Print'],
 (tng) (tng) (tng) (tng) (tng) (tng) ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
 (tng) (tng) (tng) (tng) (tng) (tng) ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
 (tng) (tng) (tng) (tng) (tng) (tng) ['OrderedList','UnorderedList','-','Outdent','Indent'],
 (tng) (tng) (tng) (tng) (tng) (tng) ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
 (tng) (tng) (tng) (tng) (tng) (tng) ['Link','Unlink'],
 (tng) (tng) (tng) (tng) (tng) (tng) ['Image','Table','Rule','SpecialChar','Smiley'],
 (tng) (tng) (tng) (tng) (tng) (tng) ['Style','FontFormat','FontName','FontSize'],
 (tng) (tng) (tng) (tng) (tng) (tng) ['TextColor','BGColor'],
 (tng) (tng) (tng) (tng) (tng) (tng) ['About']
] ;

2、简体中文设|?br />
~辑edit/lang/fcklanguagemanager.js

下面语?br />
FCKLanguageManager.AvailableLanguages =
{
 (tng)'ar' (tng) (tng): 'Arabic',
 (tng)'bs' (tng) (tng): 'Bosnian',
 (tng)'ca' (tng) (tng): 'Catalan',
 (tng)'en' (tng) (tng): 'English',
 (tng)'es' (tng) (tng): 'Spanish',
 (tng)'et' (tng) (tng): 'Estonian',
 (tng)'fi' (tng) (tng): 'Finnish',
 (tng)'fr' (tng) (tng): 'French',
 (tng)'gr' (tng) (tng): 'Greek',
 (tng)'he' (tng) (tng): 'Hebrew',
 (tng)'hr' (tng) (tng): 'Croatian',
 (tng)'it' (tng) (tng): 'Italian',
 (tng)'ko' (tng) (tng): 'Korean',
 (tng)'lt' (tng) (tng): 'Lithuanian',
 (tng)'no' (tng) (tng): 'Norwegian',
 (tng)'pl' (tng) (tng): 'Polish',
 (tng)'sr' (tng) (tng): 'Serbian (Cyrillic)',
 (tng)'sr-latn' (tng): 'Serbian (Latin)',
 (tng)'sv' (tng) (tng): 'Swedish'
}

d一?'zh-cn' (tng) (tng) (tng) : 'Chinese' 从而变?br />
FCKLanguageManager.AvailableLanguages =
{
 (tng)'ar' (tng) (tng): 'Arabic',
 (tng)'bs' (tng) (tng): 'Bosnian',
 (tng)'ca' (tng) (tng): 'Catalan',
 (tng)'en' (tng) (tng): 'English',
 (tng)'es' (tng) (tng): 'Spanish',
 (tng)'et' (tng) (tng): 'Estonian',
 (tng)'fi' (tng) (tng): 'Finnish',
 (tng)'fr' (tng) (tng): 'French',
 (tng)'gr' (tng) (tng): 'Greek',
 (tng)'he' (tng) (tng): 'Hebrew',
 (tng)'hr' (tng) (tng): 'Croatian',
 (tng)'it' (tng) (tng): 'Italian',
 (tng)'ko' (tng) (tng): 'Korean',
 (tng)'lt' (tng) (tng): 'Lithuanian',
 (tng)'no' (tng) (tng): 'Norwegian',
 (tng)'pl' (tng) (tng): 'Polish',
 (tng)'sr' (tng) (tng): 'Serbian (Cyrillic)',
 (tng)'sr-latn' (tng): 'Serbian (Latin)',
 (tng)'sv' (tng) (tng): 'Swedish',
 (tng)'zh-cn' (tng) (tng) (tng)  (tng): 'Chinese'
}

  然后到这?a >http://www.shaof.com/download/zh-cn.js下蝲汉化好的zh-cn.js保存到editor/lang目录下即可?/div>

]]>log4j 学习(fn)http://www.aygfsteel.com/huanghuizz/articles/72590.html七匹?/dc:creator>七匹?/author>Thu, 28 Sep 2006 07:31:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/72590.htmlhttp://www.aygfsteel.com/huanghuizz/comments/72590.htmlhttp://www.aygfsteel.com/huanghuizz/articles/72590.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/72590.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/72590.html

]]>
命名规则http://www.aygfsteel.com/huanghuizz/articles/71498.html七匹?/dc:creator>七匹?/author>Sat, 23 Sep 2006 15:18:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/71498.htmlhttp://www.aygfsteel.com/huanghuizz/comments/71498.htmlhttp://www.aygfsteel.com/huanghuizz/articles/71498.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/71498.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/71498.html

]]>
获得客户端的iphttp://www.aygfsteel.com/huanghuizz/articles/70813.html七匹?/dc:creator>七匹?/author>Wed, 20 Sep 2006 07:27:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/70813.htmlhttp://www.aygfsteel.com/huanghuizz/comments/70813.htmlhttp://www.aygfsteel.com/huanghuizz/articles/70813.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/70813.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/70813.html在IIS+Weblogic整合pȝ中,像移动网关一Piisforwardq个ISAPIqo(h)器也?x)对request对象q行再包装,附加一些WLS要用的头信息。这U情况下Q直接用request.getRemoteAddr()是无法取到真正的客户IP的?br />
实际的iisforward附加头如下:(x)

WL-Proxy-Client-IP=211.161.1.239
Proxy-Client-IP=211.161.1.239
X-Forwarded-For=211.161.1.239
WL-Proxy-Client-Keysize=
WL-Proxy-Client-Secretkeysize=
X-WebLogic-Request-ClusterInfo=true
X-WebLogic-KeepAliveSecs=30
X-WebLogic-Force-JVMID=-327089098
WL-Proxy-SSL=false
lgQ正作法如下:(x)
public String getIpAddr(HttpServletRequest request) {
    String ip=request.getHeader("X-Forwarded-For");
    if(ip == null || ip.length() == 0) {
        ip=request.getHeader("Proxy-Client-IP");
    }
    if(ip == null || ip.length() == 0) {
        ip=request.getHeader("WL-Proxy-Client-IP");
    }
    if(ip == null || ip.length() == 0) {
        ip=request.getRemoteAddr();
    }
    return ip;
}
如此一来,可适应各种情况Q包括通过Ud|关讉KQ会(x)附加X-Forwarded-ForQ。通过q个单例子可以看出封装和抽象的重要性?

]]>
HibernateE序性能优化的考虑要点http://www.aygfsteel.com/huanghuizz/articles/70214.html七匹?/dc:creator>七匹?/author>Mon, 18 Sep 2006 01:32:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/70214.htmlhttp://www.aygfsteel.com/huanghuizz/comments/70214.htmlhttp://www.aygfsteel.com/huanghuizz/articles/70214.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/70214.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/70214.html  初用HIBERNATE的h也许都遇到过性能问题Q实现同一功能Q用HIBERNATE与用JDBC性能相差十几倍很正常Q如果不?qing)早调整Q很可能影响整个目的进度?/p>

  大体上,对于HIBERNATE性能调优的主要考虑点如?

  Ø 数据库设计调?/p>

  Ø HQL优化

  Ø API的正?如根据不同的业务cd选用不同的集合及(qing)查询API)

  Ø 主配|参?日志Q查询缓存,fetch_size, batch_size{?

  Ø 映射文g优化(ID生成{略Q二U缓存,延迟加蝲Q关联优?

  Ø 一U缓存的理

  Ø 针对二~存Q还有许多特有的{略

  Ø 事务控制{略?/p>

  1?数据库设?/p>

  a) 降低兌的复杂?/p>

  b) 量不用联合主?/p>

  c) ID的生成机Ӟ不同的数据库所提供的机制ƈ不完全一?/p>

  d) 适当的冗余数据,不过分追求高范式

  2?HQL优化

  HQL如果抛开它同HIBERNATE本n一些缓存机制的兌QHQL的优化技巧同普通的SQL优化技巧一P可以很容易在|上扑ֈ一些经验之谈?/p>

  3?主配|?/p>

  a) 查询~存Q同下面讲的~存?sh)太一P它是针对HQL语句的缓存,卛_全一L(fng)语句再次执行时可以利用缓存数据。但是,查询~存在一个交易系l?数据变更频繁Q查询条件相同的机率q不?中可能会(x)起反作用:它会(x)白白耗费大量的系l资源但却难以派上用场?/p>

  b) fetch_sizeQ同JDBC的相兛_C用类|参数q不是越大越好,而应Ҏ(gu)业务特征去设|?/p>

  c) batch_size同上?/p>

  d) 生pȝ中,切记要关掉SQL语句打印?/p>

  4?~存

  a) 数据库~存:q~存是最高效和安全的Q但不同的数据库可管理的层次q不一P比如Q在ORACLE中,可以在徏表时指定整个表|于~存当中?/p>

  b) SESSION~存:在一个HIBERNATE SESSION有效Q这U缓存的可干预性不强,大多于HIBERNATE自动理Q但它提供清除缓存的Ҏ(gu)Q这在大扚w增加/更新操作是有效的。比如,同时增加十万条记录,按常规方式进行,很可能会(x)发现OutofMemeroy的异常,q时可能需要手动清除这一U缓?Session.evict以及(qing)Session.clear

  c) 应用~存:在一个SESSIONFACTORY中有效,因此也是优化的重中之重,因此Q各cȝ略也考虑的较多,在将数据攑օq一U缓存(sh)前,需要考虑一些前提条?

  i. 数据不会(x)被第三方修改(比如Q是否有另一个应用也在修改这些数?)

  ii. 数据不会(x)太大

  iii. 数据不会(x)频繁更新(否则使用CACHE可能适得其反)

  iv. 数据?x)被频繁查?/p>

  v. 数据不是关键数据(如涉?qing)钱Q安全等斚w的问??/p>

  ~存有几UŞ式,可以在映文件中配置:read-only(只读Q适用于很变更的?rn)态数?历史数据)Qnonstrict-read-writeQread-write(比较普遍的Ş式,效率一?Qtransactional(JTA中,且支持的~存?sh)品较?

  d) 分布式缓?同c)的配|一P只是~存?sh)品的选用不同Q在目前的HIBERNATE中可供选择的不多,oscache, jboss cacheQ目前的大多数项目,对它们的用于集群的?特别是关键交易系l?都持保守态度。在集群环境中,只利用数据库U的~存是最安全的?/p>

  5?延迟加蝲

  a) 实体延迟加蝲:通过使用动态代理实?/p>

  b) 集合延迟加蝲:通过实现自有的SET/LISTQHIBERNATE提供?jin)这斚w的支?/p>

  c) 属性gq加?

  6?Ҏ(gu)选用

  a) 完成同样一件事QHIBERNATE提供?jin)可供选择的一些方式,但具体用什么方式,可能用性能/代码都会(x)有媄(jing)响。显C,一ơ返回十万条记录(List/Set/Bag/Map{?q行处理Q很可能D内存?sh)够的问题,而如果用Z游标(ScrollableResults)或Iterator的结果集Q则不存在这L(fng)问题?/p>

  b) Session的load/getҎ(gu)Q前者会(x)使用二~存Q而后者则不用?/p>

  c) Query和list/iteratorQ如果去仔细研究一下它们,你可能会(x)发现很多有意思的情况Q二者主要区?如果使用?jin)SpringQ在HibernateTemplate中对应find,iteratorҎ(gu)):

  i. list只能利用查询~存(但在交易pȝ中查询缓存(sh)用不?Q无法利用二U缓存(sh)的单个实体,但list查出的对象会(x)写入二~存Q但它一般只生成较少的执行SQL语句Q很多情况就是一?无关??/p>

  ii. iterator则可以利用二U缓存,对于一条查询语句,它会(x)先从数据库中扑և所有符合条件的记录的IDQ再通过IDȝ存找Q对于缓存(sh)没有的记录,再构造语句从数据库中查出Q因此很Ҏ(gu)知道Q如果缓存(sh)没有MW合条g的记录,使用iterator?x)生N+1条SQL语句(N为符合条件的记录?

  iii. 通过iteratorQ配合缓存管理APIQ在量数据查询中可以很好的解决内存问题Q如:

  while(it.hasNext()){

  YouObject object = (YouObject)it.next();

  session.evict(youObject);

  sessionFactory.evice(YouObject.class, youObject.getId());

  }

  如果用listҎ(gu)Q很可能出OutofMemory错误?jin)?/p>

  iv. 通过上面的说明,我想你应该知道如何去使用q两个方法了(jin)?/p>

  7?集合的选用

  在HIBERNATE 3.1文档的?9.5. Understanding Collection performance”中有详l的说明?/p>

  8?事务控制

  事务斚wҎ(gu)能有媄(jing)响的主要包括:事务方式的选用Q事务隔ȝ别以?qing)锁的选用

  a) 事务方式选用:如果不涉?qing)多个事务管理器事务的话Q不需要用JTAQ只有JDBC的事务控制就可以?/p>

  b) 事务隔离U别:参见标准的SQL事务隔离U别

  c) 锁的选用:(zhn)观?一般由具体的事务管理器实现)Q对于长事务效率低,但安全。乐观锁(一般在应用U别实现)Q如在HIBERNATE中可以定义VERSION字段Q显?dng)如果有多个应用操作数据,且这些应用不是用同一U乐观锁机制Q则乐观锁会(x)失效。因此,针对不同的数据应有不同的{略Q同前面许多情况一P很多时候我们是在效率与安全/准确性上找一个^衡点Q无论如何,优化都不是一个纯技术的问题Q你应该对你的应用和业务特征有够的?jin)解?/p>

  9?扚w操作

  即是用JDBCQ在q行大批数据更新ӞBATCH与不使用BATCH有效率上也有很大的差别。我们可以通过讄batch_size来让其支持批量操作?/p>

  举个例子Q要扚w删除某表中的对象Q如“delete Account”,打出来的语句Q会(x)发现HIBERNATE扑և?jin)所有ACCOUNT的IDQ再q行删除Q这主要是ؓ(f)?jin)维护二U缓存,q样效率肯定高(sh)?jin),在后l的版本中增加了(jin)bulk delete/updateQ但q也无法解决~存的维护问题。也是_(d)׃有了(jin)二~存的维护问题,HIBERNATE的批量操作效率ƈ不尽如h?

  从前面许多要点可以看出,很多时候我们是在效率与安全/准确性上找一个^衡点Q无论如何,优化都不是一个纯技术的问题Q你应该对你的应用和业务特征有够的?jin)解Q一般的Q优化方案应在架构设计期基本确定,否则可能D没必要的q工Q致佉K目g期,而作为架构师和项目经理,q要面对开发h员可能的抱怨,必竟Q我们对用户需求更改的控制力不大,但技?架构风险是应该在初期意识到ƈ制定好相关的对策?/p>

  q有一点要注意Q应用层的缓存只是锦上添花,永远不要把它当救命稻草,应用的根?数据库设计,法Q高效的操作语句Q恰当API的选择{?才是最重要的?/p>

]]>
谈cmshttp://www.aygfsteel.com/huanghuizz/articles/66838.html七匹?/dc:creator>七匹?/author>Thu, 31 Aug 2006 04:31:00 GMThttp://www.aygfsteel.com/huanghuizz/articles/66838.htmlhttp://www.aygfsteel.com/huanghuizz/comments/66838.htmlhttp://www.aygfsteel.com/huanghuizz/articles/66838.html#Feedback0http://www.aygfsteel.com/huanghuizz/comments/commentRss/66838.htmlhttp://www.aygfsteel.com/huanghuizz/services/trackbacks/66838.html
cms的大概的程如下Q?br /> (tng) (tng) (tng) (tng) (tng) (tng)面的制作(自定义规则,方便解析Q-Q-Q-》保存到数据库-Q-Q-Q》定时的发布Q发布时的解析,生成?rn)态的面Q发布到哪个目录Q。?br />
 (tng) (tng) (tng)程大概如下Q但因ؓ(f)q和需求的不同数据库也不同的解析的方式也不同。本人才知道程Q具体还?sh)清。请各位大虾指点好的书籍和好的方法?img src ="http://www.aygfsteel.com/huanghuizz/aggbug/66838.html" width = "1" height = "1" />

]]>
վ֩ģ壺 º| ޵| | Ӱ| | ®| | | | | ɶ| ˮ| | | | | ɽ| | | ̨| | | °Ͷ| ͷ| | Ϻӿ| | | | | | | ɽ| ʢ| | Ȫ| | | | | |