XSLTFilter.javaAPI DocExample6991Sun Nov 23 16:09:00 GMT 2003decoratorexample.controller


public class XSLTFilter extends Object implements Filter
A filter that performs an XSLT filtering operation on the selected file before it is output.

Fields Summary
private FilterConfig
The filter configuration object
Constructors Summary
public XSLTFilter()

Methods Summary
public voiddestroy()
Called by the container when the filter is removed

public voiddoFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain)
Perform the actual filtering. Wrap the respsponse with an XSLT response wrapper.

        ServletContext sc = filterConfig.getServletContext();
        // wrap the response
        XSLTResponseWrapper xsltResponse = 
            new XSLTResponseWrapper((HttpServletResponse)response, 
        HttpServletRequest httpRequest = (HttpServletRequest) request;
        // forward to the next filter
        chain.doFilter(httpRequest, xsltResponse);
        // write the actual response to the client
        sc.log("write response");
public voidinit(javax.servlet.FilterConfig filterConfig)
Called by the container when the filter is initialized

        this.filterConfig = filterConfig;