|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.jelly.TagSupport
org.apache.commons.jelly.tags.http.HttpTagSupport
public abstract class HttpTagSupport
The base tag for all http requests
Field Summary | |
---|---|
private boolean |
_followRedirects
whether or not to follow redirects |
private java.util.List |
_parameters
list of parameters as name value pairs |
private java.lang.String |
_path
the path to be tested relative to the host/port specifed on the parent suite tag . |
private java.util.List |
_requestHeaders
list of headers as name value pairs |
private java.lang.String |
_uri
The complete uri to be processed Either this property or the path and the suite's host
must be provided. |
private java.lang.String |
_var
unique identifier of the tag/ variable to store result in |
private static java.lang.String |
HEADER_NAME_USER_AGENT
the header name for the user agent |
Fields inherited from class org.apache.commons.jelly.TagSupport |
---|
body, context, hasTrimmed, parent, shouldTrim |
Constructor Summary | |
---|---|
HttpTagSupport()
Creates a new instance of HttpTag |
Method Summary | |
---|---|
void |
addParameter(java.lang.String name,
java.lang.String value)
Add a parameter to the list |
void |
addRequestHeader(java.lang.String name,
java.lang.String value)
Add a request header to the list |
void |
doTag(org.apache.commons.jelly.XMLOutput xmlOutput)
Perform the tag functionality. |
private org.apache.commons.httpclient.HttpMethod |
getConfiguredHttpMethod()
retrieve the method from the subclass and
configure it ready for execution |
private org.apache.commons.httpclient.HttpClient |
getHttpClient()
return a HttpClient shared on the session tag, or a new one if no session tag exists |
protected abstract org.apache.commons.httpclient.HttpMethod |
getHttpMethod()
A method that must be implemented by subclasses to provide the url method implementation |
java.util.List |
getParameters()
Getter for property parameters. |
java.lang.String |
getPath()
Getter for property path. |
java.util.List |
getRequestHeaders()
Getter for property requestHeaders. |
java.lang.String |
getResolvedUrl()
|
private SessionTag |
getSessionTag()
retrieve the optional parent session tag |
java.lang.String |
getUri()
Getter for property uri. |
java.lang.String |
getVar()
Getter for property var. |
boolean |
isFollowRedirects()
Getter for property followRedirects. |
void |
setFollowRedirects(boolean followRedirects)
Setter for property followRedirects. |
protected void |
setParameters(org.apache.commons.httpclient.HttpMethod method)
Set the current parameters on the url method ready for processing |
void |
setParameters(java.util.List parameters)
Setter for property parameters. |
void |
setPath(java.lang.String path)
Setter for property path. |
void |
setRequestHeaders(java.util.List requestHeaders)
Setter for property requestHeaders. |
void |
setUri(java.lang.String uri)
Setter for property uri. |
void |
setVar(java.lang.String var)
Setter for property var. |
Methods inherited from class org.apache.commons.jelly.TagSupport |
---|
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String _var
private java.lang.String _path
suite tag
.
Either this property and the suite's host
must be provided, or the url
property must be specifed
private java.lang.String _uri
path
and the suite's host
must be provided.
private boolean _followRedirects
private java.util.List _parameters
private java.util.List _requestHeaders
private static final java.lang.String HEADER_NAME_USER_AGENT
Constructor Detail |
---|
public HttpTagSupport()
Method Detail |
---|
public java.lang.String getResolvedUrl()
protected abstract org.apache.commons.httpclient.HttpMethod getHttpMethod() throws java.net.MalformedURLException
url method
implementation
java.net.MalformedURLException
- when the url
or
path
is invalidpublic void doTag(org.apache.commons.jelly.XMLOutput xmlOutput) throws org.apache.commons.jelly.JellyTagException
xmlOutput
- where to send output
org.apache.commons.jelly.JellyTagException
- when an error occursprivate org.apache.commons.httpclient.HttpMethod getConfiguredHttpMethod() throws java.net.MalformedURLException
method
from the subclass and
configure it ready for execution
method
java.net.MalformedURLException
- when retrieving the URL failsprotected void setParameters(org.apache.commons.httpclient.HttpMethod method) throws java.net.MalformedURLException
method
- the method
to configure
java.net.MalformedURLException
- when #getHttpUrlMethod()
doesprivate SessionTag getSessionTag()
SessionTag
or null if
not foundprivate org.apache.commons.httpclient.HttpClient getHttpClient()
public void addParameter(java.lang.String name, java.lang.String value)
name
- the parameter namevalue
- the parameter valuepublic void addRequestHeader(java.lang.String name, java.lang.String value)
name
- the header namevalue
- the header valuepublic java.lang.String getVar()
public void setVar(java.lang.String var)
var
- New value of property var.public java.lang.String getPath()
public void setPath(java.lang.String path)
path
- New value of property path.public java.lang.String getUri()
public void setUri(java.lang.String uri)
uri
- New value of property uri.public boolean isFollowRedirects()
public void setFollowRedirects(boolean followRedirects)
followRedirects
- New value of property followRedirects.public java.util.List getParameters()
public void setParameters(java.util.List parameters)
parameters
- New value of property parameters.public java.util.List getRequestHeaders()
public void setRequestHeaders(java.util.List requestHeaders)
requestHeaders
- New value of property requestHeaders.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |