: Class HtmlFilter

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mortbay.HTTP.Filter
Class HtmlFilter

    java.lang.Object
      |
      +--java.io.OutputStream
            |
            +--java.io.FilterOutputStream
                  |
                  +--com.mortbay.HTTP.HttpFilter
                        |
                        +--com.mortbay.HTTP.Filter.HtmlFilter

Direct Known Subclasses:
  HtmlExpireFilter

public class HtmlFilter
extends HttpFilter

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:

- Strings
- Double instances
- out - An OutputStream to which output can be directed.
- data - which is a Hashtable associated with the current request.
- request - which is the HttpRequest.
- context - which is the ServerContext.
- null - null value.
- 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 com.mortbay.HTTP.HttpFilter
  `request, response`

  Fields inherited from class java.io.FilterOutputStream
  `out`

  Constructor Summary
  `HtmlFilter(HttpRequest request)` Constructor.

  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 com.mortbay.HTTP.HttpFilter
  `activateOn, test, update`

  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`

  Field Detail

  ### info

      protected java.util.Hashtable info

  Constructor Detail

  ### 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.

  Method Detail

  ### 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 output
      `request` - The HttpRequest to make the url relative to.
      `url` - the url as a string
      `proxyUrl` - the proxy as a Url like "http://proxyhost:proxyport/" or null if no proxy

  Overview | Package | Class | Tree | Deprecated | Index | Help
  PREV CLASS NEXT CLASS | FRAMES NO FRAMES
  SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD