1 16 package org.apache.taglibs.dbtags.resultset; 17 18 import java.io.IOException ; 19 20 import javax.servlet.jsp.JspTagException ; 21 import javax.servlet.jsp.tagext.TagSupport ; 22 23 46 public class RowCountTag extends TagSupport { 47 48 public int doStartTag() throws JspTagException { 49 50 Integer integer = 51 (Integer ) pageContext.getAttribute("org.apache.taglibs.dbtags.resultset.rowcount"); 52 53 if (integer == null) { 54 throw new JspTagException ("rowCount tag must be used inside or after a ResultSet tag."); 55 } 56 57 try { 58 pageContext.getOut().write(integer.toString()); 59 } catch (IOException e) { 60 throw new JspTagException (e.toString()); 61 } 62 63 return SKIP_BODY; 64 } 65 66 } 67 | Popular Tags |