Filter Html for java method tags
This HttpFilter is used to expand dynamic content within a
HTML template file. The HTML template file should contain
java method tags where dynamic content is to be included.
A java method tag is a HTML comment of the form:
<!=:packageName.className.methodName(arg1,arg2,...)>
The MethodTag class is used to create a method call to the
static method described. Arguments that can be passed
include:
Any HTTPRequest parameter
Any object returned by the tag is sent to the response output.
The special tag <!=SESSION> is expanded to the session
URL encoding if it is required.
The assumption is made that
- Version:
- $Id: HtmlFilter.java,v 2.21 2000/11/07 15:34:38 gregwilkins Exp $
- Author:
- Greg Wilkins
- See Also:
FilterHandler
Field Summary |
protected java.util.Hashtable |
info
|
Fields inherited from class java.io.FilterOutputStream |
out |
Method Summary |
protected void |
activate()
Modify response on activation. |
protected boolean |
canHandle(java.lang.String contentType)
Can handle text/html |
static void |
embedUrl(java.io.OutputStream out,
HttpRequest request,
java.lang.String urlString,
java.lang.String proxyUrlString)
Embed a URL
GET the page at the given URL. |
static void |
includeFile(java.io.OutputStream out,
java.lang.String directory,
java.lang.String fileName)
|
static void |
includePreFile(java.io.OutputStream out,
java.lang.String directory,
java.lang.String fileName)
|
void |
write(byte[] b)
|
void |
write(byte[] buf,
int off,
int len)
|
void |
write(int b)
|
Methods inherited from class java.io.FilterOutputStream |
close,
flush |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
info
protected java.util.Hashtable info
HtmlFilter
public HtmlFilter(HttpRequest request)
- Constructor.
The If-Modified-Since and If-Unmodified-since headers are
blanked as it is possible for this filter to modify the
content, even if it has not changed at source.
- Parameters:
request
- The Request.
canHandle
protected boolean canHandle(java.lang.String contentType)
- Can handle text/html
- Overrides:
- canHandle in class HttpFilter
activate
protected void activate()
- Modify response on activation.
Remove content length and reset the last modified headers, as they
are possibly incorrect after filtering.
Add "Expired" header to disable external caching.
- Overrides:
- activate in class HttpFilter
write
public void write(byte[] b)
throws java.io.IOException
- Overrides:
- write in class java.io.FilterOutputStream
write
public void write(byte[] buf,
int off,
int len)
throws java.io.IOException
- Overrides:
- write in class java.io.FilterOutputStream
write
public void write(int b)
throws java.io.IOException
- Overrides:
- write in class java.io.FilterOutputStream
includeFile
public static void includeFile(java.io.OutputStream out,
java.lang.String directory,
java.lang.String fileName)
throws java.io.IOException
includePreFile
public static void includePreFile(java.io.OutputStream out,
java.lang.String directory,
java.lang.String fileName)
throws java.io.IOException
embedUrl
public static void embedUrl(java.io.OutputStream out,
HttpRequest request,
java.lang.String urlString,
java.lang.String proxyUrlString)
throws java.io.IOException
- Embed a URL
GET the page at the given URL.
- Parameters:
out
- Where to write the outputrequest
- The HttpRequest to make the url relative to.url
- the url as a stringproxyUrl
- the proxy as a Url like "http://proxyhost:proxyport/"
or null if no proxy