1 16 17 package org.apache.taglibs.scrape; 18 19 import java.util.*; 20 import javax.servlet.jsp.*; 21 import javax.servlet.jsp.tagext.*; 22 23 46 public class UrlTag extends BodyTagSupport { 47 48 49 60 public final int doAfterBody() throws JspException { 61 62 PageTag myparent = (PageTag)javax.servlet.jsp.tagext.TagSupport.findAncestorWithClass(this, PageTag.class); 64 String url; 66 if (myparent == null) 67 throw new JspException("url tag not nested within page tag"); 68 else { 69 if ((url = bodyContent.getString()) != null) { 70 myparent.setUrl(url); myparent.getPage(); } else 73 throw new JspException("Url for the page to be scraped was not " 74 + "provided"); 75 } 76 return SKIP_BODY; 77 } 78 } 79 | Popular Tags |