1 53 54 106 107 package com.Yasna.forum.tags; 108 109 import java.io.*; 110 import java.util.*; 111 import javax.servlet.*; 112 import javax.servlet.jsp.*; 113 import javax.servlet.jsp.tagext.*; 114 import javax.servlet.http.*; 115 import com.Yasna.forum.*; 116 import com.Yasna.forum.tags.*; 117 118 150 151 public class PrevItemTag extends TagSupport 152 { 153 private String next = null; 154 155 160 public final int doStartTag() throws JspException 161 { 162 Paging pa = null; 165 try { 166 pa = (Paging)this.findAncestorWithClass(this, 167 Class.forName("com.Yasna.forum.tags.Paging")); 168 next = pa.prevItem(); 169 } catch(Exception e) { 170 } 171 172 if( next == null ) 173 next = ""; 174 175 return SKIP_BODY; 176 } 177 178 183 public final int doEndTag() throws JspException 184 { 185 try { 186 pageContext.getOut().write(next); 187 } catch(Exception e) { 188 throw new JspException("IO Error: " + e.getMessage()); 189 } 190 return EVAL_PAGE; 191 } 192 193 } 194 | Popular Tags |