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

XSLTFilter

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
filterConfig
The filter configuration object
Constructors Summary
public XSLTFilter()
Constructor

    
          
      
    
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();
     
        sc.log("DoFilter");
        
        
        
        // wrap the response
        XSLTResponseWrapper xsltResponse = 
            new XSLTResponseWrapper((HttpServletResponse)response, 
                                    "/SimpleTransform.xml");
        HttpServletRequest httpRequest = (HttpServletRequest) request;
        
        // forward to the next filter
        chain.doFilter(httpRequest, xsltResponse);
        
        // write the actual response to the client
        sc.log("write response");
        xsltResponse.writeResponse();
    
public voidinit(javax.servlet.FilterConfig filterConfig)
Called by the container when the filter is initialized

        this.filterConfig = filterConfig;