I used some tags that I didn't use much. I didn't save much strength. I learned that I wrote one of my own labels. I feel ok. The following is the example: public class Tag extends BodyTagSupport {private String sql; public int doStartTag () {return this.EVAL_BODY_BUFFERED;} public void setSql (String arg) {this.sql = arg;} String field; public void setField (String arg) {this. field = arg;} public int intPageIndex; private void initParameter (javax.servlet.ServletRequest request) {try {String pageindex = request.getParameter ( "emPageIndex"); pageindex = pageindex == null || pageindex.equals ( "_ emPageIndex_" )? "0": PageIndex; INTPAGEINDEX = INTEGER.PARSEINT (PageIndex); if (Request.getParameter ("first")! = Null) INTPAGEINDEX = 0; Else IF (Request.GetParameter ("Piror")! = NULL) intPageIndex = intPageIndex-1; (! request.getParameter ( "next") = null) else if intPageIndex = intPageIndex 1; else if (! request.getParameter ( "last") = null) intPageIndex = 100000;} catch (Exception EX) {INTPAGEINDEX = 0;} Public int doendtag () throws javax.servlet.jsp.jspexception {TRY {initParameter (this.pagecontext.getRequest ()); string body = this.getBodyContent (). GetString (); String navigation = body.substring (0, body.indexof (" Pagination page = new Pagination (sql, intPageIndex); sun.jdbc.rowset.CachedRowSet rowset = page.getRcord (); String field; navigation = navigation.replaceAll ( "_curpage_", (page.getPageIndex () 1) " "); Navigation = navigation.replaceAll (" _PAGECUNT_ ", ()" "" "; navigation = navigation.replaceAll (" _RecordCount_ ", (page.getRecordCount ()) " ""; navigation = navigation .replaceAll ("_empageindex_", ()) "" "; this.pageContext.get (). Write (navigation); if (RowSet! = null) {string Temp; for (int J = 1; RowSet.next (); pageContext.get (). Write (" } _ _CURPAGE_PPAG _PageCount_ page A total _Recordcount _ 条 td> tr> Sequence No. TD> Title TD> Start Time TD> End Time TD> Moderator TD> Location TD > Tr> & _no _ td> _2 _ td> _3 _ td> _4 _ td> _6 _ td> < TD> _5 _ td> & tr> table> em: query> tag.javaimport javax.servlet.jsp. *; import javax.servlet.jsp.tagext.tagsupport; import javax.servlet.jsp .tagext.bodytagsupport;
&") - 1); String Data = body.substring (Body.indexof (" &") 5, body.indexof (" & tr> "); string tail = body.substring (Body.indexof (" & TR> ") 6, body.length ());
/ n" temp " tr> / n"), J ) {TEMP = Data; Temp = Temp.ReplaceAll ("_ NO_" , J ""); int size = rowset.getMetadata (). getColumnCount (); for (int i = 1; i <= size; i ) {TEMP = Temp.Replaceall ("_" i "_", com.sinosoft.util.tool.jutilities.getstring (rowset, i));}}} t His.pageContext.get (). Write (tail);} catch (exception e) {// throw new JSPEXCEPTION ("IO Error:" E.GetMessage ()); E.PrintStackTrace ();} returnval_page;}