﻿<?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-Skynet-随笔分类-JspTag</title><link>http://www.blogjava.net/Good-Game/category/24759.html</link><description /><language>zh-cn</language><lastBuildDate>Wed, 02 Apr 2008 21:09:08 GMT</lastBuildDate><pubDate>Wed, 02 Apr 2008 21:09:08 GMT</pubDate><ttl>60</ttl><item><title>分页 乱码问题（解决）</title><link>http://www.blogjava.net/Good-Game/archive/2008/04/01/190115.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Tue, 01 Apr 2008 08:13:00 GMT</pubDate><guid>http://www.blogjava.net/Good-Game/archive/2008/04/01/190115.html</guid><wfw:comment>http://www.blogjava.net/Good-Game/comments/190115.html</wfw:comment><comments>http://www.blogjava.net/Good-Game/archive/2008/04/01/190115.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Good-Game/comments/commentRss/190115.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Good-Game/services/trackbacks/190115.html</trackback:ping><description><![CDATA[上一个blog中 粗略的使用了下<a id="Editor_Results_rprSelectionList_ctl03_LinkTitle" class="titlelink" href="/Good-Game/archive/2008/01/29/178375.html">分页标签使用 pg</a><br />使用问题还是有很多 如 分页中乱码、多java代码块<br />下面用一个 &lt;jsp:include &gt;来解决这些问题。<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">    <font color="#006400">&lt;!-- 使用写好的分页jsp 当中需要参数为 count 总结果个数 / maxPageItems（可选默认10）页面显示行数 / goUrl （可选默认本页） 跳转路径 /  params  request中参数 应为乱码问题 <b><font color="#a52a2a">传给下一个页面</font></b> 需要使用URLDecoder.decode(...） 如：String productName = URLDecoder.decode( request.getParameter("productName")==null?"":request.getParameter("productName"),"utf8" );<br />     <br />    --&gt;</font><br /></span><span style="color: rgb(0, 0, 255);">    &lt;</span><span style="color: rgb(128, 0, 0);">jsp:include </span><span style="color: rgb(255, 0, 0);">page</span><span style="color: rgb(0, 0, 255);">="../jspUtil/page.jsp"</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);">jsp:param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="count"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="&lt;%=OrderServiceImp.getOrdersCount(beginTime,endTime,userName,companyName,productName,null,zq)%&gt;"</span><span style="color: rgb(255, 0, 0);">  </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);">jsp:param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="maxPageItems"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="10"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />        <br />            </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">jsp:param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="goUrl"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="/zhongqi/seleProduct.do"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />        <br />        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">jsp:param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="params"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="beginTime"</span><span style="color: rgb(255, 0, 0);"> </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);">jsp:param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="params"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="endTime"</span><span style="color: rgb(255, 0, 0);"> </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);">jsp:param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="params"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="userName"</span><span style="color: rgb(255, 0, 0);"> </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);">jsp:param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="params"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="companyName"</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);">jsp:param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="params"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="productName"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/&gt;</span><span style="color: rgb(0, 0, 0);"><br />        <br />    </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">jsp:include</span><span style="color: rgb(0, 0, 255);">&gt;</span></div><span style="color: rgb(0, 0, 255);"><b><br />page.jsp</b><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">%@ page </span><span style="color: rgb(255, 0, 0);">language</span><span style="color: rgb(0, 0, 255);">="java"</span><span style="color: rgb(255, 0, 0);"> import</span><span style="color: rgb(0, 0, 255);">="java.util.*"</span><span style="color: rgb(255, 0, 0);"> pageEncoding</span><span style="color: rgb(0, 0, 255);">="UTF-8"</span><span style="color: rgb(255, 0, 0);">%</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);">%@page </span><span style="color: rgb(255, 0, 0);">import</span><span style="color: rgb(0, 0, 255);">="java.net.URLEncoder"</span><span style="color: rgb(255, 0, 0);">%</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);">%@page </span><span style="color: rgb(255, 0, 0);">import</span><span style="color: rgb(0, 0, 255);">="java.net.URLDecoder"</span><span style="color: rgb(255, 0, 0);">%</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);">%@ taglib </span><span style="color: rgb(255, 0, 0);">prefix</span><span style="color: rgb(0, 0, 255);">="pg"</span><span style="color: rgb(255, 0, 0);"> uri</span><span style="color: rgb(0, 0, 255);">="/WEB-INF/pager-taglib.tld"</span><span style="color: rgb(255, 0, 0);"> %</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">%<br />    int </span><span style="color: rgb(255, 0, 0);">count </span><span style="color: rgb(0, 0, 255);">= Integer.parseInt( </span><span style="color: rgb(255, 0, 0);">request.getParameter("count") );<br />    int maxPageItems </span><span style="color: rgb(0, 0, 255);">= Integer.parseInt( </span><span style="color: rgb(255, 0, 0);">request.getParameter("maxPageItems")</span><span style="color: rgb(0, 0, 255);">==null?"10":request.getParameter("maxPageItems") </span><span style="color: rgb(255, 0, 0);">);<br />    <br />   <font color="#006400"> //参数设置 &lt;jsp:param name</font></span><font color="#006400"><span style="color: rgb(0, 0, 255);">="params"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">="xx"</span><span style="color: rgb(255, 0, 0);">  </span><span style="color: rgb(0, 0, 255);">/&gt;</span></font><span style="color: rgb(0, 0, 0);"><br />    String[] params = (String[])request.getParameterMap().get("params");<br />    <br />    String goUrl = request.getParameter("goUrl");<br />    <br />%&gt;<br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">div </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="bgee"</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);">div </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);">pg:pager<br />  </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="pager"</span><span style="color: rgb(255, 0, 0);"><br />  url</span><span style="color: rgb(0, 0, 255);">="&lt;%=goUrl%&gt;"</span><span style="color: rgb(255, 0, 0);"><br />  items</span><span style="color: rgb(0, 0, 255);">='&lt;%=count%&gt;'<br />  </span><span style="color: rgb(255, 0, 0);">maxPageItems</span><span style="color: rgb(0, 0, 255);">="&lt;%=maxPageItems %&gt;"</span><span style="color: rgb(255, 0, 0);"><br />  export</span><span style="color: rgb(0, 0, 255);">="offset,currentPageNumber=pageNumber"</span><span style="color: rgb(255, 0, 0);"><br />  isOffset</span><span style="color: rgb(0, 0, 255);">="false"</span><span style="color: rgb(255, 0, 0);"><br />  scope</span><span style="color: rgb(0, 0, 255);">="request"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />  <br /></span><span style="color: rgb(0, 0, 255);">   &lt;</span><span style="color: rgb(128, 0, 0);">% <br />    for</span><span style="color: rgb(255, 0, 0);">( String str : params ) {<br />        if (request.getParameter(str) !</span><span style="color: rgb(0, 0, 255);">= null </span><span style="color: rgb(255, 0, 0);">&amp;&amp; !request.getParameter(str).equals("")) {%</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);">pg:param </span><span style="color: rgb(255, 0, 0);">name</span><span style="color: rgb(0, 0, 255);">="&lt;%=str %&gt;"</span><span style="color: rgb(255, 0, 0);"> value</span><span style="color: rgb(0, 0, 255);">='&lt;%= </span><span style="color: rgb(255, 0, 0);">URLEncoder.encode( URLDecoder.decode(request.getParameter(str),"utf-8"),"utf-8")%</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">'/&gt;<br />        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">% }<br />    }%</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /><br /><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">pg:index</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);">pg:prev </span><span style="color: rgb(255, 0, 0);">ifnull</span><span style="color: rgb(0, 0, 255);">="true"</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);">span</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);">% if </span><span style="color: rgb(255, 0, 0);">(pageUrl !</span><span style="color: rgb(0, 0, 255);">= null) </span><span style="color: rgb(255, 0, 0);">{ %</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);">A </span><span style="color: rgb(255, 0, 0);">HREF</span><span style="color: rgb(0, 0, 255);">="&lt;%= pageUrl %&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(255, 0, 0);">&amp;lt;</span><span style="color: rgb(0, 0, 0);"> 上一页</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">A</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);">% } %</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);">span</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);">pg:prev</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br />  </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">pg:pages </span><span style="color: rgb(255, 0, 0);">export</span><span style="color: rgb(0, 0, 255);">="pageUrl, pageNumber"</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);">% if </span><span style="color: rgb(255, 0, 0);">(pageNumber </span><span style="color: rgb(0, 0, 255);">== </span><span style="color: rgb(255, 0, 0);">currentPageNumber) { %</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);">span</span><span style="color: rgb(0, 0, 255);">&gt;&lt;</span><span style="color: rgb(128, 0, 0);">%= pageNumber </span><span style="color: rgb(255, 0, 0);">%</span><span style="color: rgb(0, 0, 255);">&gt;&lt;/</span><span style="color: rgb(128, 0, 0);">span</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);">%} else </span><span style="color: rgb(255, 0, 0);">{%</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);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">='&lt;%=pageUrl%&gt;'&gt;&lt;%= </span><span style="color: rgb(255, 0, 0);">pageNumber %</span><span style="color: rgb(0, 0, 255);">&gt;&lt;/</span><span style="color: rgb(128, 0, 0);">a</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);">%}%</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);">pg:pages</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);">pg:next </span><span style="color: rgb(255, 0, 0);">ifnull</span><span style="color: rgb(0, 0, 255);">="true"</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);">% if </span><span style="color: rgb(255, 0, 0);">(pageUrl !</span><span style="color: rgb(0, 0, 255);">= null) </span><span style="color: rgb(255, 0, 0);">{ %</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);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">='&lt;%=pageUrl%&gt;'&gt;下一页 </span><span style="color: rgb(255, 0, 0);">&amp;gt;&lt;/a</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);">%}%</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);">pg:next</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);">pg:index</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);">pg:pager</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);">div</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);">div</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span></div><br /><br /><br /><b><br /></b></span><br /><br /><img src ="http://www.blogjava.net/Good-Game/aggbug/190115.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Good-Game/" target="_blank">G_G</a> 2008-04-01 16:13 <a href="http://www.blogjava.net/Good-Game/archive/2008/04/01/190115.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>分页查询+hbn</title><link>http://www.blogjava.net/Good-Game/archive/2008/03/09/184818.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Sun, 09 Mar 2008 04:13:00 GMT</pubDate><guid>http://www.blogjava.net/Good-Game/archive/2008/03/09/184818.html</guid><wfw:comment>http://www.blogjava.net/Good-Game/comments/184818.html</wfw:comment><comments>http://www.blogjava.net/Good-Game/archive/2008/03/09/184818.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/Good-Game/comments/commentRss/184818.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Good-Game/services/trackbacks/184818.html</trackback:ping><description><![CDATA[使用标签 这是以 get 提交<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);"><b>&lt;%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %&gt;</b><br /><br />&lt;</span><span style="color: rgb(128, 0, 0);">div </span><span style="color: rgb(255, 0, 0);">align</span><span style="color: rgb(0, 0, 255);">="center"</span><span style="color: rgb(255, 0, 0);"> id</span><span style="color: rgb(0, 0, 255);">="bgee"</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);">pg:pager </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="pager"</span><span style="color: rgb(255, 0, 0);"> <br />              url</span><span style="color: rgb(0, 0, 255);">='bonusdetailaction.do'<br />              </span><span style="color: rgb(255, 0, 0);">items</span><span style="color: rgb(0, 0, 255);">='&lt;%=max%</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">' <br />              maxPageItems='10'<br />                export="offset,currentPageNumber=pageNumber"  <br />                isOffset="false"  <br />                scope="request"&gt;<br />        </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">pg:index</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);">pg:prev</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(255, 0, 0);">&amp;nbsp;</span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%= response.encodeURL(pageUrl.replaceAll("</span><span style="color: rgb(255, 0, 0);">&amp;", "&amp;amp;")) %</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(255, 0, 0);">&amp;method</span><span style="color: rgb(0, 0, 0);">=paginationEnquiries</span><span style="color: rgb(255, 0, 0);">&amp;rId</span><span style="color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">request.getAttribute(</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">rId</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">) </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);">"&gt;[上一页]</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">a</span><span style="color: rgb(0, 0, 255);">&gt;&lt;/</span><span style="color: rgb(128, 0, 0);">pg:prev</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);">pg:pages </span><span style="color: rgb(255, 0, 0);">export</span><span style="color: rgb(0, 0, 255);">="pageUrl, pageNumber"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"><br />                      </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">if</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> (pageNumber </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">==</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> currentPageNumber) {<br />                </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&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);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> pageNumber </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"><br />                      } </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">else</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> {<br />                </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&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);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%= response.encodeURL(pageUrl.replaceAll("</span><span style="color: rgb(255, 0, 0);">&amp;", "&amp;amp;")) %</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(255, 0, 0);">&amp;method</span><span style="color: rgb(0, 0, 0);">=paginationEnquiries</span><span style="color: rgb(255, 0, 0);">&amp;rId</span><span style="color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">request.getAttribute(</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">rId</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">) </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);">"&gt;</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> pageNumber </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">a</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />                </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"><br />                      }<br />                   </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&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);">pg:pages</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);">pg:next</span><span style="color: rgb(0, 0, 255);">&gt;&lt;</span><span style="color: rgb(128, 0, 0);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%= response.encodeURL(pageUrl.replaceAll("</span><span style="color: rgb(255, 0, 0);">&amp;", "&amp;amp;")) %</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(255, 0, 0);">&amp;method</span><span style="color: rgb(0, 0, 0);">=paginationEnquiries</span><span style="color: rgb(255, 0, 0);">&amp;rId</span><span style="color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">request.getAttribute(</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">rId</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">) </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);">"&gt;[下一页]</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">a</span><span style="color: rgb(0, 0, 255);">&gt;&lt;/</span><span style="color: rgb(128, 0, 0);">pg:next</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);">pg:index</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);">pg:pager</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);">div</span><span style="color: rgb(0, 0, 255);">&gt;</span></div><br />action <br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">        </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> startNum </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> getParam(request, </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">pageroffset</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);">int</span><span style="color: rgb(0, 0, 0);"> itms </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> getParam(request, </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">maxPageItems</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);">);<br /></span></div><br />dao <br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">            Query qu </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> session.createQuery(hql).setLong(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">rid</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, rw.getId());<br />            qu.setFirstResult(start);<br />            qu.setMaxResults(</span><span style="color: rgb(0, 0, 0);">itms </span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);">);</span></div><br /><br /><br /><img src ="http://www.blogjava.net/Good-Game/aggbug/184818.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Good-Game/" target="_blank">G_G</a> 2008-03-09 12:13 <a href="http://www.blogjava.net/Good-Game/archive/2008/03/09/184818.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>分页标签使用 pg</title><link>http://www.blogjava.net/Good-Game/archive/2008/01/29/178375.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Tue, 29 Jan 2008 07:57:00 GMT</pubDate><guid>http://www.blogjava.net/Good-Game/archive/2008/01/29/178375.html</guid><wfw:comment>http://www.blogjava.net/Good-Game/comments/178375.html</wfw:comment><comments>http://www.blogjava.net/Good-Game/archive/2008/01/29/178375.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Good-Game/comments/commentRss/178375.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Good-Game/services/trackbacks/178375.html</trackback:ping><description><![CDATA[使用：pager-taglib-2.0 <br />官方：http://jsptags.com/tags/navigation/pager<br /><br />使用页面：<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">@ taglib prefix</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">pg</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> uri</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">/WEB-INF/pager-taglib.tld</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">@ page language</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">java</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> import</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">java.util.*</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> pageEncoding</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">ISO-8859-1</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"><br /></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> path </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> request.getContextPath();<br /></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> basePath </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> request.getScheme()</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">+</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">://</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">+</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">request.getServerName()</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">+</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">:</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">+</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">request.getServerPort()</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">+</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">path</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">+</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">/</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">;<br /></span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">&lt;!</span><span style="color: rgb(255, 0, 255);">DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"</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</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);">head</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);">base </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%=basePath%&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    <br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">My JSP 'pg.jsp' starting page</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    <br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="pragma"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="no-cache"</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);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="cache-control"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="no-cache"</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);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="expires"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="0"</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);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="keywords"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="keyword1,keyword2,keyword3"</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);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="description"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="This is my page"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 128, 0);">&lt;!--</span><span style="color: rgb(0, 128, 0);"><br />    &lt;link rel="stylesheet" type="text/css" href="styles.css"&gt;<br />    </span><span style="color: rgb(0, 128, 0);">--&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">!<br /> </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">private</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> static final </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> getParam(ServletRequest request, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> name,<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> defval)<br />{<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> param </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> request.getParameter(name);<br />    return (param !</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">null</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> ? param : defval);<br />}<br /><br /></span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">private</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> static final </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">int</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> getParam(ServletRequest request, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> name,<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">int</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> defval)<br />{<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> param </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> request.getParameter(name);<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">int</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> value </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> defval;<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">if</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> (param !</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">null</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">) {<br />    try { value </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">Integer</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">.parseInt(param); }<br />    catch (NumberFormatException ignore) { }<br />    }<br />    return value;<br />}<br /></span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"><br />   </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> style </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> getParam(request,</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">style</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">simple</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">);<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> position </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> getParam(request, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">position</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">top</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">);<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">String</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> index </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> getParam(request, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">index</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">center</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">);<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">int</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> maxPageItems </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> getParam(request, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">maxPageItems</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">10</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">);<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">int</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> maxIndexPages </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> getParam(request, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">maxIndexPages</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">, </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">10</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">);<br />    <br />    List list </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">new</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> ArrayList();<br />    </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">for</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">(</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">int</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> i</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">0</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">;i</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">&lt;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">1000</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">;i</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">++</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">){<br />        list.add(i);<br />    } </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&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);">head</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />  <br />  </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">body</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);">form </span><span style="color: rgb(255, 0, 0);">action</span><span style="color: rgb(0, 0, 255);">="&lt;%= request.getRequestURI() %&gt;"</span><span style="color: rgb(255, 0, 0);"> method</span><span style="color: rgb(0, 0, 255);">="get"</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);">center</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    <br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">pg:pager<br />    </span><span style="color: rgb(255, 0, 0);">items</span><span style="color: rgb(0, 0, 255);">="&lt;%= list.size() %&gt;"</span><span style="color: rgb(255, 0, 0);"><br />    index</span><span style="color: rgb(0, 0, 255);">="&lt;%= index %&gt;"</span><span style="color: rgb(255, 0, 0);"><br />    maxPageItems</span><span style="color: rgb(0, 0, 255);">="&lt;%= maxPageItems %&gt;"</span><span style="color: rgb(255, 0, 0);"><br />    maxIndexPages</span><span style="color: rgb(0, 0, 255);">="&lt;%= maxIndexPages %&gt;"</span><span style="color: rgb(255, 0, 0);"><br />    isOffset</span><span style="color: rgb(0, 0, 255);">="&lt;%= true %&gt;"</span><span style="color: rgb(255, 0, 0);"><br />    export</span><span style="color: rgb(0, 0, 255);">="offset,currentPageNumber=pageNumber"</span><span style="color: rgb(255, 0, 0);"><br />    scope</span><span style="color: rgb(0, 0, 255);">="request"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br />       <br /><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">pg:index</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />       </span><span style="color: rgb(0, 128, 0);">&lt;!--</span><span style="color: rgb(0, 128, 0);"> 引用标签页面   </span><span style="color: rgb(0, 128, 0);">--&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);">jsp:include </span><span style="color: rgb(255, 0, 0);">page</span><span style="color: rgb(0, 0, 255);">="../jsp/texticon.jsp"</span><span style="color: rgb(255, 0, 0);"> flush</span><span style="color: rgb(0, 0, 255);">="true"</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);">pg:index</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br />///////////////////////////////////////////////////////////////////////////////////////////////////////////////<br />  </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">hr</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);">width</span><span style="color: rgb(0, 0, 255);">="90%"</span><span style="color: rgb(255, 0, 0);"> cellspacing</span><span style="color: rgb(0, 0, 255);">="4"</span><span style="color: rgb(255, 0, 0);"> cellpadding</span><span style="color: rgb(0, 0, 255);">="4"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />  </span><span style="color: rgb(0, 128, 0);">&lt;!--</span><span style="color: rgb(0, 128, 0);"> 这里参数 l为结尾数 i-&gt;offset.intValue() 起点数   </span><span style="color: rgb(0, 128, 0);">--&gt;</span><span style="color: rgb(0, 0, 0);"><br />  </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">for</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> (</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">int</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> i </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> offset.intValue(),<br />             l </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> Math.min(i </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">+</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> maxPageItems, list.size());<br />         i </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">&lt;</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> l; i</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">++</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">)<br />    {</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);"><br />    <br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">pg:item</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);">tr</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);">th</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);">font </span><span style="color: rgb(255, 0, 0);">color</span><span style="color: rgb(0, 0, 255);">="&lt;%= list.get(i) %&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> i </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">+</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">1</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">font</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);">th</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);">tr</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);">pg:item</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">}</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&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(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);">hr</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">pg:pager</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br />  </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">body</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</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span></div><br /><br />定义分页标签样式页：<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">@ page session</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">false</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">@ taglib uri</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">http://jsptags.com/tags/navigation/pager</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> prefix</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">pg</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">"</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&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);">jsp:useBean </span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="currentPageNumber"</span><span style="color: rgb(255, 0, 0);"> type</span><span style="color: rgb(0, 0, 255);">="java.lang.Integer"</span><span style="color: rgb(255, 0, 0);"> scope</span><span style="color: rgb(0, 0, 255);">="request"</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);">font </span><span style="color: rgb(255, 0, 0);">face</span><span style="color: rgb(0, 0, 255);">="fixed"</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);">pg:first </span><span style="color: rgb(255, 0, 0);">export</span><span style="color: rgb(0, 0, 255);">="firstPageUrl=pageUrl"</span><span style="color: rgb(255, 0, 0);"> unless</span><span style="color: rgb(0, 0, 255);">="current"</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);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%= firstPageUrl %&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">|</span><span style="color: rgb(255, 0, 0);">&amp;lt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">a</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);">pg:first</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);">pg:skip </span><span style="color: rgb(255, 0, 0);">export</span><span style="color: rgb(0, 0, 255);">="skipBackPageUrl=pageUrl"</span><span style="color: rgb(255, 0, 0);"> pages</span><span style="color: rgb(0, 0, 255);">="&lt;%= -10 %&gt;"</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);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%= skipBackPageUrl %&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(255, 0, 0);">&amp;lt;&amp;lt;&amp;lt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">a</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);">pg:skip</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);">pg:prev </span><span style="color: rgb(255, 0, 0);">export</span><span style="color: rgb(0, 0, 255);">="prevPageUrl=pageUrl"</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);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%= prevPageUrl %&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(255, 0, 0);">&amp;lt;&amp;lt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">a</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);">pg:prev</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);">pg:pages</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"><br />  </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">if</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> (pageNumber </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">==</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> currentPageNumber) {<br />    </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> pageNumber </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">b</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"><br />  } </span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 255);">else</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> {<br />    </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%= pageUrl %&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);">=</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"> pageNumber </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">a</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"> </span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">&lt;%</span><span style="background-color: rgb(245, 245, 245); color: rgb(0, 0, 0);"><br />  }<br /></span><span style="background-color: rgb(255, 255, 0); color: rgb(0, 0, 0);">%&gt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">pg:pages</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);">pg:next </span><span style="color: rgb(255, 0, 0);">export</span><span style="color: rgb(0, 0, 255);">="nextPageUrl=pageUrl"</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);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%= nextPageUrl %&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(255, 0, 0);">&amp;gt;&amp;gt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">a</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);">pg:next</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);">pg:skip </span><span style="color: rgb(255, 0, 0);">export</span><span style="color: rgb(0, 0, 255);">="skipForwardPageUrl=pageUrl"</span><span style="color: rgb(255, 0, 0);"> pages</span><span style="color: rgb(0, 0, 255);">="&lt;%= 10 %&gt;"</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);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%= skipForwardPageUrl %&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(255, 0, 0);">&amp;gt;&amp;gt;&amp;gt;</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">a</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);">pg:skip</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);">pg:last </span><span style="color: rgb(255, 0, 0);">export</span><span style="color: rgb(0, 0, 255);">="lastPageUrl=pageUrl"</span><span style="color: rgb(255, 0, 0);"> unless</span><span style="color: rgb(0, 0, 255);">="current"</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);">a </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%= lastPageUrl %&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(255, 0, 0);">&amp;gt;</span><span style="color: rgb(0, 0, 0);">|</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">a</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);">pg:last</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);">font</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /><br /></span></div><br /><img src ="http://www.blogjava.net/Good-Game/aggbug/178375.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Good-Game/" target="_blank">G_G</a> 2008-01-29 15:57 <a href="http://www.blogjava.net/Good-Game/archive/2008/01/29/178375.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>EL 标签小例 </title><link>http://www.blogjava.net/Good-Game/archive/2007/08/02/133928.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Thu, 02 Aug 2007 02:13:00 GMT</pubDate><guid>http://www.blogjava.net/Good-Game/archive/2007/08/02/133928.html</guid><wfw:comment>http://www.blogjava.net/Good-Game/comments/133928.html</wfw:comment><comments>http://www.blogjava.net/Good-Game/archive/2007/08/02/133928.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/Good-Game/comments/commentRss/133928.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Good-Game/services/trackbacks/133928.html</trackback:ping><description><![CDATA[
		<font color="#ff0000">
				<b>问题：</b>
		</font>jsp 的简化与 统一性<br /><font color="#0000ff"><b>解决：</b></font> EL 标签<br /><br />jsp.页面<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">%@ taglib </span><span style="color: rgb(255, 0, 0);">prefix</span><span style="color: rgb(0, 0, 255);">="fn"</span><span style="color: rgb(255, 0, 0);"> uri</span><span style="color: rgb(0, 0, 255);">="/WEB-INF/fn.tld"</span><span style="color: rgb(255, 0, 0);"> %</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);">%@ taglib </span><span style="color: rgb(255, 0, 0);">prefix</span><span style="color: rgb(0, 0, 255);">="c"</span><span style="color: rgb(255, 0, 0);"> uri</span><span style="color: rgb(0, 0, 255);">="/WEB-INF/c-1_0-rt.tld"</span><span style="color: rgb(255, 0, 0);"> %</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);">%@ taglib </span><span style="color: rgb(255, 0, 0);">prefix</span><span style="color: rgb(0, 0, 255);">="x"</span><span style="color: rgb(255, 0, 0);"> uri</span><span style="color: rgb(0, 0, 255);">="/WEB-INF/x-1_0-rt.tld"</span><span style="color: rgb(255, 0, 0);"> %</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);">%@ page </span><span style="color: rgb(255, 0, 0);"></span><span style="color: rgb(0, 0, 0);"><font color="#ff0000">isELIgnored</font><font color="#0000ff">="</font><font color="#ff0000">false</font><font color="#0000ff">" <font color="#ff0000">%</font>&gt;</font><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">%@ page </span><span style="color: rgb(255, 0, 0);">language</span><span style="color: rgb(0, 0, 255);">="java"</span><span style="color: rgb(255, 0, 0);"> import</span><span style="color: rgb(0, 0, 255);">="java.util.*"</span><span style="color: rgb(255, 0, 0);"> pageEncoding</span><span style="color: rgb(0, 0, 255);">="UTF-8"</span><span style="color: rgb(255, 0, 0);">%</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /><br /></span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">%<br />String </span><span style="color: rgb(255, 0, 0);">path </span><span style="color: rgb(0, 0, 255);">= request.getContextPath();<br /></span><span style="color: rgb(255, 0, 0);">String basePath </span><span style="color: rgb(0, 0, 255);">= request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";<br /></span><span style="color: rgb(255, 0, 0);">%</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">&lt;!</span><span style="color: rgb(255, 0, 255);">DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"</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</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);">head</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);">base </span><span style="color: rgb(255, 0, 0);">href</span><span style="color: rgb(0, 0, 255);">="&lt;%=basePath%&gt;"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    <br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">My JSP 'MyJsp.jsp' starting page</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    <br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="pragma"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="no-cache"</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);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="cache-control"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="no-cache"</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);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="expires"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="0"</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);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="keywords"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="keyword1,keyword2,keyword3"</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);">meta </span><span style="color: rgb(255, 0, 0);">http-equiv</span><span style="color: rgb(0, 0, 255);">="description"</span><span style="color: rgb(255, 0, 0);"> content</span><span style="color: rgb(0, 0, 255);">="This is my page"</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />    <br />    </span><span style="color: rgb(0, 128, 0);">&lt;!--</span><span style="color: rgb(0, 128, 0);"><br />    &lt;link rel="stylesheet" type="text/css" href="styles.css"&gt;<br />    </span><span style="color: rgb(0, 128, 0);">--&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);">head</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />  <br />  </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">body</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);">c:set </span><span style="color: rgb(255, 0, 0);">var</span><span style="color: rgb(0, 0, 255);">="url"</span><span style="color: rgb(0, 0, 255);">&gt;&lt;</span><span style="color: rgb(128, 0, 0);">%=basePath</span><span style="color: rgb(255, 0, 0);">%</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);">/xml</span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">c:set</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);">c:import </span><span style="color: rgb(255, 0, 0);">var</span><span style="color: rgb(0, 0, 255);">="xmlDoc"</span><span style="color: rgb(255, 0, 0);"> url</span><span style="color: rgb(0, 0, 255);">="${url}"</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);">x:parse </span><span style="color: rgb(255, 0, 0);">xml</span><span style="color: rgb(0, 0, 255);">="${xmlDoc}"</span><span style="color: rgb(255, 0, 0);"> var</span><span style="color: rgb(0, 0, 255);">="doc"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">/&gt;</span>
				                                    <font color="#006400">//xml解析</font><span style="color: rgb(0, 0, 0);"><font color="#006400"></font><br />    </span><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">c:set </span><span style="color: rgb(255, 0, 0);">var</span><span style="color: rgb(0, 0, 255);">="bookName"</span><span style="color: rgb(255, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">&gt;&lt;</span><span style="color: rgb(128, 0, 0);">x:out </span><span style="color: rgb(255, 0, 0);">select</span><span style="color: rgb(0, 0, 255);">="$doc/xml-body/books/book[@id='1']"</span><span style="color: rgb(0, 0, 255);">/&gt;&lt;/</span><span style="color: rgb(128, 0, 0);">c:set</span><span style="color: rgb(0, 0, 255);">&gt;</span>
				 <span style="color: rgb(0, 0, 0);"><font color="#008000">
						//xml 定位 </font><br />    ${fn:substring(bookName,"0", fn:length(bookName)-2 ) }&lt;br&gt;                          <font color="#008000"> //字符substring<br /><br /><font color="#0000ff">     &lt;x:forEach var="item" select="$doc/xml-body/books/book"  &gt;      <font color="#006400"> //迭带</font><br />        &lt;x:out select="$item" /&gt;&lt;br&gt;<br />     &lt;/x:forEach&gt;</font><br />    <br /></font>  </span><span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">body</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</span><span style="color: rgb(0, 0, 255);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /></span></div><br /><br /><b>结果得到是</b><font size="4"><b>:   <font color="#0000ff" size="4">book1_goog </font></b></font><b><font size="4"><br /><font color="#0000ff">              book1_google<br />            book2_baidu<br />            book3_tiancai</font></font></b><br />/xml 路径是<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 255);">package</span><span style="color: rgb(0, 0, 0);"> Servlet;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.io.IOException;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.io.PrintWriter;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.servlet.ServletException;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.servlet.http.HttpServlet;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.servlet.http.HttpServletRequest;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> javax.servlet.http.HttpServletResponse;<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);">class</span><span style="color: rgb(0, 0, 0);"> XmlServlet </span><span style="color: rgb(0, 0, 255);">extends</span><span style="color: rgb(0, 0, 0);"> HttpServlet {<br />    </span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br />     * <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);">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);">final</span><span style="color: rgb(0, 0, 0);"> String CONTENT_TYPE </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);">text/html; charset=GBK</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);">public</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);"> init() </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> ServletException{}<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);">void</span><span style="color: rgb(0, 0, 0);"> doGet(     HttpServletRequest request,<br />                        HttpServletResponse response )<br />                        </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> ServletException,IOException{<br />        PrintWriter out </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> response.getWriter();<br />        <br />        response.setContentType(CONTENT_TYPE);<br />        response.setCharacterEncoding(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">GBK</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        <br />        <br />        out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;?xml version='1.0' encoding='UTF-8'?&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;xml-body&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />                out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;name&gt;RW&lt;/name&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />                out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;passWord&gt;123456&lt;/passWord&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />                out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;age&gt;28&lt;/age&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />                out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;books&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />                        out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;book id='1'&gt;book1_google&lt;/book&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);  <font color="#006400">//jsp 定位得到的  字符</font><br />                        out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;book id='2'&gt;book2_baidu&lt;/book&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />                        out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;book id='3'&gt;book3_tiancai&lt;/book&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />                        out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;/books&gt;</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        out.print(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">&lt;/xml-body&gt;</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);">public</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);"> doPost( HttpServletRequest request,<br />                        HttpServletResponse response )<br />                        </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> ServletException,IOException{<br />        doGet(request,response);<br />    }<br />}<br /></span></div><br /><b><font color="#006400">心得：写EL心情 就是好</font></b><br /><br /><img src ="http://www.blogjava.net/Good-Game/aggbug/133928.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Good-Game/" target="_blank">G_G</a> 2007-08-02 10:13 <a href="http://www.blogjava.net/Good-Game/archive/2007/08/02/133928.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JSP 自定义标签笔记</title><link>http://www.blogjava.net/Good-Game/archive/2007/07/30/133253.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Mon, 30 Jul 2007 03:52:00 GMT</pubDate><guid>http://www.blogjava.net/Good-Game/archive/2007/07/30/133253.html</guid><wfw:comment>http://www.blogjava.net/Good-Game/comments/133253.html</wfw:comment><comments>http://www.blogjava.net/Good-Game/archive/2007/07/30/133253.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Good-Game/comments/commentRss/133253.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Good-Game/services/trackbacks/133253.html</trackback:ping><description><![CDATA[JSP 自定义标签<br />  1. &lt;my:list pass="${pass}"/&gt;pass 的建立是(1)tld文件加 &lt;attribute&gt;(2).java加 private String pass gget() gset() <br />  2. 要有 Body .java 就继承 BodyTagSupport 不要就   TagSupport<br />  3.  doStartTag() 中 输出是  pageContext.getOut().print("hello."+this.pass); <br />  4.  doAfterBody() 中 输出是 BodyContent bc = super.getBodyContent();<br />                                      String bStr = bc.getString(); <font color="#006400">// body 中的 string <br />                                   <font color="#000000">bc.getEnclosingWriter().print(...); <font color="#006400"> // out to jsp<br /><font color="#000000">  5. &lt;my:list pass="liukaiyi"&gt;<br />          &lt;c:if test="${gg==null}"&gt;  <font color="#006400"> //会先运行得到 String 再在 </font></font></font></font>bc.getString()得到 String</font><font color="#006400"></font><font color="#006400"><font color="#000000"><font color="#006400"><font color="#000000"><br />              XX<br />          &lt;/c:if&gt;<br />     &lt;/my:list&gt;</font><br /></font></font></font>  4.  .java 中 通过是 doStartTag() <br />                        return SKIP_BODY  跳向 doEndTag()<br />                              return EVAL_BODY_INCLUDE 跳过主体 doBodyContent()<br />                              return EVAL_BODY_BUFFERED 调用doInitBody() <br />  5.  .java 中 doAfterBody() <br />                              return SKIP_BODY 跳出循环 到 doEndTag()<br />                              return EVAL_BODY_AGAIN 再次 doAfterBody()<br />  6.  .java 中 doEndTag() <br />                              retrun EVAL_PAGE 继续剩余<br />                              return SKIP_PAGE 跳出<br /><br />Tag 自定义标签<br />  1. &lt;%@ taglib prefix="my" tagdir="/WEB-INF/tags" %&gt; 倒入 并在 tags 文件中 建 XXX.tag<br />  2. 使用 EG: &lt;my:文件名 /&gt;<br />  3. &lt;my:MyTag items="${name}" /&gt;在文件.tag中加入 &lt;%@ attribute name="items"%&gt;<br />                                 并在 body中${items}就可以使用<br />  4. body加标签 同 JSP 自定义标签 5 <br />  5.   &lt;my:MyTag items="d" &gt;<br />          &lt;jsp:attribute name="list"&gt;  <font color="#006400">//添加body模块</font><br />              ..&lt;&gt;..<br />          &lt;/jsp:attribute&gt;<br />       &lt;/my:MyTag&gt;<br />       在 .tag 中 &lt;%@ attribute name="list" fragment="true" required="true" %&gt; 取得<br />        &lt;jsp:invoke fragment="list" /&gt; 使用中的 String <br /><img src ="http://www.blogjava.net/Good-Game/aggbug/133253.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Good-Game/" target="_blank">G_G</a> 2007-07-30 11:52 <a href="http://www.blogjava.net/Good-Game/archive/2007/07/30/133253.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>extremecomponents 初使用</title><link>http://www.blogjava.net/Good-Game/archive/2007/04/24/113206.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Tue, 24 Apr 2007 07:51:00 GMT</pubDate><guid>http://www.blogjava.net/Good-Game/archive/2007/04/24/113206.html</guid><wfw:comment>http://www.blogjava.net/Good-Game/comments/113206.html</wfw:comment><comments>http://www.blogjava.net/Good-Game/archive/2007/04/24/113206.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Good-Game/comments/commentRss/113206.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Good-Game/services/trackbacks/113206.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &lt;?				xml version="1.0" encoding="UTF-8"				?&gt;																																				&lt;!				DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "ht...&nbsp;&nbsp;<a href='http://www.blogjava.net/Good-Game/archive/2007/04/24/113206.html'>阅读全文</a><img src ="http://www.blogjava.net/Good-Game/aggbug/113206.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Good-Game/" target="_blank">G_G</a> 2007-04-24 15:51 <a href="http://www.blogjava.net/Good-Game/archive/2007/04/24/113206.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>