org.ejtools.servlet.http
Class XSLFilter

java.lang.Object
  |
  +--org.ejtools.servlet.http.XSLFilter
All Implemented Interfaces:
javax.servlet.Filter

public class XSLFilter
extends java.lang.Object
implements javax.servlet.Filter

HTTP Servlet filter that applies a XSL stylesheet on a XML stream.

Version:
$Revision: 1.3 $
Author:
Laurent Etiemble

Field Summary
protected  javax.servlet.FilterConfig config
          Filter configuration
protected  java.lang.String contentType
          Content type of the output
protected static org.apache.log4j.Logger logger
          Log4j Logger
protected  java.lang.String stylePath
          Absolute path the stylesheet
protected  javax.xml.transform.Transformer transformer
          XSL transformer
 
Constructor Summary
XSLFilter()
           
 
Method Summary
 void destroy()
          Destroy the filter
 void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
          Main method of the filter
 void init(javax.servlet.FilterConfig config)
          Performs the initialization of the filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected javax.servlet.FilterConfig config
Filter configuration


contentType

protected java.lang.String contentType
Content type of the output


stylePath

protected java.lang.String stylePath
Absolute path the stylesheet


transformer

protected javax.xml.transform.Transformer transformer
XSL transformer


logger

protected static org.apache.log4j.Logger logger
Log4j Logger

Constructor Detail

XSLFilter

public XSLFilter()
Method Detail

destroy

public void destroy()
Destroy the filter

Specified by:
destroy in interface javax.servlet.Filter

doFilter

public void doFilter(javax.servlet.ServletRequest request,
                     javax.servlet.ServletResponse response,
                     javax.servlet.FilterChain chain)
              throws java.io.IOException,
                     javax.servlet.ServletException
Main method of the filter

Specified by:
doFilter in interface javax.servlet.Filter
Parameters:
request - Incoming request
response - Outgoing response
chain - Filter chain to forward the request and the response
Throws:
java.io.IOException - In case of error
javax.servlet.ServletException - In case of error

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Performs the initialization of the filter

Specified by:
init in interface javax.servlet.Filter
Parameters:
config - The filter configuration
Throws:
javax.servlet.ServletException - Exception thrown if the filter was not properly configured


Copyright © 2002-2003 EJTools Org.. All Rights Reserved.