Custom JSP tags library lets you perform HTTP HEAD requests.
Tag HttpHead lets you request for example size and content type for the remote file,
check HTTP status code (file existence) as well as modification date. E.g.:
<%@ taglib uri="taglib.tld" prefix="h" %> <h:HttpHead url="http://www.servletsuite.com/servlets/sos.zip" id="A"/> file size: <%=A.get("contentLength")%> Optional attribute id describes a name for the page scope variable (type is java.util.HashMap) with the requested attributes. You can check out the following keys: responseCode - HTTP status code. E.g. 200 - file exists, 404 - file not found etc.
Without id attribute tag prints the requested data in JSON format. E.g.: <%@ taglib uri="taglib.tld" prefix="h" %> <script language="JavaScript"> var s = <h:HttpHead url="http://servletsuite.com/servlets/sos.zip"/>; var o = eval("("+s+")"); alert("Content type is:"+o.contentType); </script> Tags are: HttpHead Tag performs HTTP HEAD request. Attributes are: 1) url Describes an URL for the remote file (host)
for downloading: Library: httpheadtag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|