1 16 17 package org.apache.taglibs.scrape; 18 19 import java.util.*; 20 import java.io.*; 21 import java.net.*; 22 import javax.servlet.jsp.*; 23 import javax.servlet.jsp.tagext.*; 24 25 51 public class ResultTag extends TagSupport { 52 53 private String scrape; 55 56 66 public final int doEndTag() throws JspException { 67 68 String result; 70 if((result = (String )pageContext.getAttribute(scrape)) != null) 72 { 73 try { 74 pageContext.getOut().write(result); } catch(IOException e) { 76 pageContext.getServletContext().log("Scrape taglib: Result tag: " + 77 e.toString() + " Couldn't perform the write"); 78 } 79 } else { 80 try { 82 pageContext.getOut().write(""); 83 } catch(IOException e) { 84 pageContext.getServletContext().log("Scrape taglib: Result tag: " + 85 " Couldn't perform the write scrape does not exist. " + 86 e.toString()); 87 } 88 } 89 return EVAL_PAGE; 90 } 91 92 98 public final void setScrape(String scrapeid) { 99 scrape = scrapeid; 100 } 101 102 } 103 | Popular Tags |