Custom JSP tags. This taglib lets you proceed HTTP requests. Options include data caching and asynchronous execution. For example:
<%@ taglib uri="taglib.tld" prefix="do" %> <html> <!-- do GET and save output in the page scope variable --> <do:GetPost url="www.acme.com/cgi-bin/script" method="get" id="A"/> <%=A%> <!-- do GET and save dowloaded file --> <do:GetPost url="www.acme.com/data/picture.gif" method="get" localPath="c:/images" /> <!-- do POST asynchronously --> <do:GetPost url="www.acme.com/cgi-bin/script" method="post" asynch="true"> <do:setParam name="A" value="12345"/> <do:setParam name="B" value="5678"/> </do:GetPost> <!-- if you did not set parameters body will be posted --> <do:GetPost url="www.webservice.net/script" method="post"> <this_XML_stuff> <will_be_posted/> </this_XML_stuff> </do:GetPost> <!-- do GET and use cache for 10 min --> <do:GetPost url="www.acme.com/cgi-bin/script" ttl="600" id="A"/> <%=A%> </html> Tags are: GetPost Proceeds HTTP request. Parameters are: 1) url URL for your request
setParam Body tag lets you define a parameter for HTTP POST request. Body describes parameter's value. 1) name describes a name for your parameter
setHeader Body tag lets you define a header for your request 1) name describes a name for your header
setAuthorization Sets user name/password for basic authentication 1) user user name
for downloading: Library: httptag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|