Jakarta Project: IO Tag library
Version: 1.0
Table of Contents
Overview
Requirements
Configuration
Tag Summary
Tag Reference
Examples
Javadocs
Revision History
Overview
The IO library allows URLs and HTTP requests to be performed using JSP
custom tags. This allows JSP to be used to perform HTTP GETs or PUT
operations and to make XML-RPC and SOAP requests.
Requirements
This custom tag library requires no software other than a servlet container
that supports the JavaServer Pages Specification, version 1.1 or higher.
Configuration
Follow these steps to configure your web application with this tag library:
To use the tags from this library in your JSP pages, add the following
directive at the top of each page:
<%@ taglib uri="http://jakarta.apache.org/taglibs/io-1.0" prefix="http" %>
where "http" is the tag name prefix you wish to use for tags
from this library. You can change this value to any prefix you like.
Tag Summary
| pipe |
Acts like a Unix pipe between tags that are not capable of piping themselves.
A pipe can take some input or some output or both.
If no input is specified then its body content is used.
If no output is specified then the current output is used.
|
| set |
Sets the property on its parent tag.
Either the body of this tag is used as the value or a PipeConsumer
can be included in my body.
|
| get |
Returns the bean or bean property and pipes it into its parent PipeConsumer tag.
|
| request |
Requests the content of the given URL.
|
| http |
Performs a HTTP request on the given URL with the specified action and optional body.
If no action is specified then it defaults to "GET".
|
| header |
Defines a URL / HTTP header for the current request tag.
The value of the header can be specified as an attribute
otherwise the value of the tags body is taken instead.
|
| param |
Defines a query argument for the URL of the current request.
The value of the parameter can be specified as an attribute
otherwise the value of the tags body is taken instead.
|
| soap |
Performs a HTTP SOAP request on the given URL, SOAPAction and body.
|
| xmlrpc |
Performs an XML RPC request on the given URL.
|
| |
Tag Reference
| pipe | Availability: version 1.0 |
|
|
Acts like a Unix pipe between tags that are not capable of piping themselves.
A pipe can take some input or some output or both.
If no input is specified then its body content is used.
If no output is specified then the current output is used.
|
| |
| Tag Class | org.apache.taglibs.io.PipeTag |
| Tag Body | JSP |
| Script Variable | No |
| Restrictions | |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| pipeInput | false | true |
|
| pipeOutput | false | true |
|
|
| Example |
-
<io:pipe input="<%= request.getReader() %>"/>
|
|
| set | Availability: version 1.0 |
|
|
Sets the property on its parent tag.
Either the body of this tag is used as the value or a PipeConsumer
can be included in my body.
|
| |
| Tag Class | org.apache.taglibs.io.SetTag |
| Tag Body | JSP |
| Script Variable | No |
| Restrictions | |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| property | true | true |
|
| pipeInput | false | true |
|
|
| Example |
-
<io:set name="url">some text with mixed tags & expressions</io:set>
|
|
| get | Availability: version 1.0 |
|
|
Returns the bean or bean property and pipes it into its parent PipeConsumer tag.
|
| |
| Tag Class | org.apache.taglibs.io.GetTag |
| Tag Body | JSP |
| Script Variable | No |
| Restrictions | |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| name | true | true |
|
| property | false | true |
|
|
| Example |
-
<io:get name="something" property"bar"/>
|
|
|
|
|
Requests the content of the given URL.
|
| |
| Tag Class | org.apache.taglibs.io.URLTag |
| Tag Body | JSP |
| Script Variable | |
| Restrictions | None |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| url | true | true |
|
| output | false | true |
|
|
| Example |
-
<io:url url="/WEB-INF/foo.xml"/>
|
|
| http | Availability: version 1.0 |
|
|
Performs a HTTP request on the given URL with the specified action and optional body.
If no action is specified then it defaults to "GET".
|
| |
| Tag Class | org.apache.taglibs.io.HttpTag |
| Tag Body | JSP |
| Script Variable | No |
| Restrictions | None |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| url | true | true |
|
| action | false | true |
|
|
| Example |
-
<io:http url="http://jakarta.apache.org" action="GET"/>
|
|
| header | Availability: version 1.0 |
|
|
Defines a URL / HTTP header for the current request tag.
The value of the header can be specified as an attribute
otherwise the value of the tags body is taken instead.
|
| |
| Tag Class | org.apache.taglibs.io.URLHeaderTag |
| Tag Body | JSP |
| Script Variable | No |
| Restrictions | None |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| name | true | true |
|
| value | false | true |
|
|
| Example |
-
<io:http url="http://jakarta.apache.org" action="GET"/>
<io:header name="Content-Type" value="text/xml"/>
</io:http>
|
|
| param | Availability: version 1.0 |
|
|
Defines a query argument for the URL of the current request.
The value of the parameter can be specified as an attribute
otherwise the value of the tags body is taken instead.
|
| |
| Tag Class | org.apache.taglibs.io.URLParameterTag |
| Tag Body | JSP |
| Script Variable | No |
| Restrictions | Must be specified before any <http:header> or <http:body> tags |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| name | true | true |
|
| value | false | true |
|
|
| Example |
-
<io:http url="http://jakarta.apache.org" action="GET"/>
<io:header name="Content-Type" value="text/xml"/>
</io:http>
|
|
| soap | Availability: version 1.0 |
|
|
Performs a HTTP SOAP request on the given URL, SOAPAction and body.
|
| |
| Tag Class | org.apache.taglibs.io.HttpSoapTag |
| Tag Body | JSP |
| Script Variable | No |
| Restrictions | None |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| url | true | true |
|
| SOAPAction | true | true |
|
|
| Example |
-
<io:soap
url="http://services.xmethods.net:80/perl/soaplite.cgi"
SOAPAction="urn:xmethodsBabelFish#BabelFish">
<io:body>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<m:BabelFish xmlns:m="urn:xmethodsBabelFish">
<translationmode>en_fr</translationmode>
<sourcedata>SOAP is quite easy with JSP.</sourcedata>
</m:BabelFish>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</io:body>
</io:soap>
|
|
| xmlrpc | Availability: version 1.0 |
|
|
Performs an XML RPC request on the given URL.
|
| |
| Tag Class | org.apache.taglibs.io.XmlRpcTag |
| Tag Body | JSP |
| Script Variable | No |
| Restrictions | None |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| url | true | true |
|
| userAgent | false | true |
|
|
| Example |
-
<io:xmlrpc url="/RPC2">
<io:body>
<?xml version="1.0"?>
<methodCall>
<methodName>examples.getStateName</methodName>
<params>
<param>
<value><i4>41</i4></value>
</param>
</params>
</methodCall>
</io:body>
</io:xmlrpc>
|
|
Examples
See the example application io-examples.war for examples of the usage
of the tags from this custom tag library.
Java Docs
Java programmers can view the java class documentation for this tag library
as javadocs.
Revision History
Review the complete revision history of this tag
library.