org.apache.commons.jelly.tags.http
Class HttpTagSupport

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.http.HttpTagSupport
All Implemented Interfaces:
org.apache.commons.jelly.Tag
Direct Known Subclasses:
DeleteTag, GetTag, HeadTag, OptionsTag, PostTag, PutTag

public abstract class HttpTagSupport
extends org.apache.commons.jelly.TagSupport

The base tag for all http requests

Version:
$Id: HttpTagSupport.java 155420 2005-02-26 13:06:03Z dirkv $
Author:
dion

Field Summary
 
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.
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()
           
 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
 

Constructor Detail

HttpTagSupport

public HttpTagSupport()
Creates a new instance of HttpTag

Method Detail

getResolvedUrl

public java.lang.String getResolvedUrl()
Returns:
the url specified by the tag, either the url if not null, or a combination of the host, port and path

getHttpMethod

protected abstract org.apache.commons.httpclient.HttpMethod getHttpMethod()
                                                                   throws java.net.MalformedURLException
A method that must be implemented by subclasses to provide the url method implementation

Returns:
a HttpUrlMethod implementation
Throws:
java.net.MalformedURLException - when the url or path is invalid

doTag

public void doTag(org.apache.commons.jelly.XMLOutput xmlOutput)
           throws org.apache.commons.jelly.JellyTagException
Perform the tag functionality. In this case, get the http url method execute it and make it available for validation

Parameters:
xmlOutput - where to send output
Throws:
org.apache.commons.jelly.JellyTagException - when an error occurs

setParameters

protected void setParameters(org.apache.commons.httpclient.HttpMethod method)
                      throws java.net.MalformedURLException
Set the current parameters on the url method ready for processing

Parameters:
method - the method to configure
Throws:
java.net.MalformedURLException - when #getHttpUrlMethod() does

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String value)
Add a parameter to the list

Parameters:
name - the parameter name
value - the parameter value

addRequestHeader

public void addRequestHeader(java.lang.String name,
                             java.lang.String value)
Add a request header to the list

Parameters:
name - the header name
value - the header value

getVar

public java.lang.String getVar()
Getter for property var.

Returns:
Value of property var.

setVar

public void setVar(java.lang.String var)
Setter for property var.

Parameters:
var - New value of property var.

getPath

public java.lang.String getPath()
Getter for property path.

Returns:
Value of property path.

setPath

public void setPath(java.lang.String path)
Setter for property path.

Parameters:
path - New value of property path.

getUri

public java.lang.String getUri()
Getter for property uri.

Returns:
Value of property uri.

setUri

public void setUri(java.lang.String uri)
Setter for property uri.

Parameters:
uri - New value of property uri.

isFollowRedirects

public boolean isFollowRedirects()
Getter for property followRedirects.

Returns:
Value of property followRedirects.

setFollowRedirects

public void setFollowRedirects(boolean followRedirects)
Setter for property followRedirects.

Parameters:
followRedirects - New value of property followRedirects.

getParameters

public java.util.List getParameters()
Getter for property parameters.

Returns:
Value of property parameters.

setParameters

public void setParameters(java.util.List parameters)
Setter for property parameters.

Parameters:
parameters - New value of property parameters.

getRequestHeaders

public java.util.List getRequestHeaders()
Getter for property requestHeaders.

Returns:
Value of property requestHeaders.

setRequestHeaders

public void setRequestHeaders(java.util.List requestHeaders)
Setter for property requestHeaders.

Parameters:
requestHeaders - New value of property requestHeaders.


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.