|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
org.apache.taglibs.scrape.PageTag
public class PageTag
PageTag - JSP tag page is used for generating an http request to a web page, it then scrapes the page for user specified text and stores the results from the scrape for later retrieval by another tag.
JSP Tag Lib Descriptor
<name>page</name>
<tagclass>org.apache.taglibs.scrape.PageTag</tagclass>
<bodycontent>JSP</bodycontent>
<info>Set the page that will be scraped</info>
<attribute>
>name>url</name>
<required>false</required>
<rtexprval>false</rtsprval>
</attribute>
<attribute>
< name>time</name>
<required>false</required>
<rtexprval>false</rtexprval>
</attribute>
<attribute>
>name>useProxy</name>
<required>false</required>
<rtexprval>false</rtsprval>
</attribute>
<attribute>
>name>proxyPort</name>
<required>false</required>
<rtexprval>false</rtsprval>
</attribute>
<attribute>
< name>proxyServer</name>
<required>false</required>
<rtexprval>false</rtexprval>
</attribute>
<attribute>
>name>proxyName</name>
<required>false</required>
<rtexprval>false</rtsprval>
</attribute>
<attribute>
< name>proxyPass</name>
<required>false</required>
<rtexprval>false</rtexprval>
</attribute>
<attribute>
< name>proxyEncode</name>
<required>false</required>
<rtexprval>false</rtexprval>
</attribute>
<attribute>
< name>charset</name>
<required>false</required>
<rtexprval>true</rtexprval>
</attribute>
PageData,
ScrapeData,
Serialized Form| Field Summary |
|---|
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
id, pageContext |
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
|---|
EVAL_BODY_AGAIN |
| Fields inherited from interface javax.servlet.jsp.tagext.Tag |
|---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
| Constructor Summary | |
|---|---|
PageTag()
|
|
| Method Summary | |
|---|---|
int |
doEndTag()
implementation of method from the Tag interface that tells the JSP what to do upon encountering the end tag for this tag |
int |
doStartTag()
implementation of method from the tag interface that tells the JSP what to do upon encounteringa the start tag for this tag |
void |
getPage()
method gets the page object from the from the static hashmap keyed to the url |
void |
setCharset(java.lang.String value)
set the value of the charset to be used |
void |
setClientPass(java.lang.String value)
set the pass word to access the client keystore |
void |
setHeader(java.lang.String name,
java.lang.String value)
set the name and value of any extra headers to be sent |
void |
setProxyName(java.lang.String value)
set the value of the username for authentication to the proxy server |
void |
setProxyPass(java.lang.String value)
set the value of the password for authentication to the proxy server |
void |
setProxyPort(java.lang.String value)
set the value of proxy port |
void |
setProxyServer(java.lang.String value)
set the value of proxy server |
void |
setScrape(java.lang.String id,
java.lang.String begin,
java.lang.String end,
java.lang.String anchors,
java.lang.String strip)
method sets the scrapedata object in the hashmap scrapes in the application scope pagedata object |
void |
setTime(java.lang.String wait)
sets the time user would like the tag to wait before making a new http connection default is 10 minutes. |
void |
setUrl(java.lang.String url)
sets the url for the http request. |
void |
setuseProxy(java.lang.String value)
set the value of proxy port |
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
|---|
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PageTag()
| Method Detail |
|---|
public final int doStartTag()
throws javax.servlet.jsp.JspException
doStartTag in interface javax.servlet.jsp.tagext.TagdoStartTag in class javax.servlet.jsp.tagext.TagSupportjavax.servlet.jsp.JspException - thrown when an error occurs with client request
processing
public final int doEndTag()
throws javax.servlet.jsp.JspException
doEndTag in interface javax.servlet.jsp.tagext.TagdoEndTag in class javax.servlet.jsp.tagext.TagSupportjavax.servlet.jsp.JspException - thrown when error occurs in processing the body of
this methodpublic final void getPage()
public final void setTime(java.lang.String wait)
throws javax.servlet.jsp.JspException
string - time in minutes must be greater than 10
javax.servlet.jsp.JspException
public final void setUrl(java.lang.String url)
throws javax.servlet.jsp.JspException
url - the url for the http request
javax.servlet.jsp.JspException
public final void setuseProxy(java.lang.String value)
throws javax.servlet.jsp.JspException
value - the proxy port to use for the connection as a String
javax.servlet.jsp.JspException
public final void setProxyPort(java.lang.String value)
throws javax.servlet.jsp.JspException
value - the proxy port to use for the connection as a String
javax.servlet.jsp.JspExceptionpublic final void setProxyServer(java.lang.String value)
value - the proxy server to use for the connectionpublic final void setProxyPass(java.lang.String value)
value - the proxy port to use for the connection as a Stringpublic final void setProxyName(java.lang.String value)
value - the proxy server to use for the connectionpublic final void setClientPass(java.lang.String value)
value - password to the client keystore
public final void setHeader(java.lang.String name,
java.lang.String value)
name - string that is the name of an extra header to be sentvalue - string that is the value of an extra header to be sentpublic final void setCharset(java.lang.String value)
value - charset to be used to scrape the page
public final void setScrape(java.lang.String id,
java.lang.String begin,
java.lang.String end,
java.lang.String anchors,
java.lang.String strip)
throws javax.servlet.jsp.JspException
id - unique identifier of the scrape the following attributes
definebegin - beginning anchor for the scrape refered to by idend - ending anchor for the scrape refered to by idanchors - boolean flag that determines if begin and end anchors are
part of the resultstrip - boolean flag that determines if tags are to be striped from
the result
javax.servlet.jsp.JspException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||