Jakarta Project: HTTP Tag library
Version: 1.0
Table of Contents
Overview
Requirements
Configuration
Tag Summary
Tag Reference
Examples
Javadocs
Revision History
Overview
The HTTP tag library allows HTTP requests to be performed using JSP
custom tags. This allows JSP to be used to perform HTTP GETs or PUT
operations for example to make 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/http-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
| request | Performs a HTTP request on the given URL with the specified action and optional body. |
| header | Defines a HTTP header for the current HTTP request tag. |
| body | Defines the HTTP body for the current HTTP request tag. |
| |
Tag Reference
|
|
| Performs a HTTP request on the given URL with the specified action and optional body. |
| |
| Tag Class | org.apache.taglibs.http.HttpRequestTag |
| Tag Body | JSP |
| Script Variable | No |
| Restrictions | None |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| url | true | true |
|
| action | true | true |
|
|
| Example |
-
<http:request url="http://jakarta.apache.org" action="GET"/>
|
|
| header | Availability: version 1.0 |
|
| Defines a HTTP header for the current HTTP request tag. |
| |
| Tag Class | org.apache.taglibs.http.HttpHeaderTag |
| Tag Body | none |
| Script Variable | No |
| Restrictions | None |
| Attributes | |
| |
| Name | Required | Runtime Expression Evaluation |
| name | true | true |
|
| value | false | true |
|
|
| Example |
-
<http:request url="http://jakarta.apache.org" action="GET"/>
<http:header name="Content-Type" value="text/xml"/>
</http:request>
|
|
| body | Availability: version 1.0 |
|
| Defines the HTTP body for the current HTTP request tag. |
| |
| Tag Class | org.apache.taglibs.http.HttpBodyTag |
| Tag Body | JSP |
| Script Variable | No |
| Restrictions | None |
| Attributes | None |
| Example |
-
<http:request url="http://services.xmethods.net:80/perl/soaplite.cgi" action="POST">
<http:header name="SOAPAction" value="urn:xmethodsBabelFish#BabelFish"/>
<http:header name="Content-Type" value="text/xml"/>
<http: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>
</http:body>
</http:request>
|
|
Examples
See the example application http-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.