home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2003 October / PCWELT_10_2003.ISO / pcwsoft / CUCKOO.z.exe / XslFilter.java < prev   
Encoding:
Java Source  |  2001-12-10  |  1.3 KB  |  38 lines

  1. package cuckoo;
  2. import java.io.*;
  3. import javax.servlet.*;
  4. import javax.servlet.http.*;
  5. /**
  6.  * Cuckoo Resin filter.
  7.  * <p>Copyright (c) 2001-2002</p>
  8.  * <pre>
  9.  * This program is free software; you can redistribute it and/or
  10.  * modify it under the terms of the GNU General Public License
  11.  * as published by the Free Software Foundation; version 2
  12.  * of the License.
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  * </pre>
  18.  * @author  Alexis Grandemange
  19.  * @version 0, 0, 1
  20.  */
  21. public class XslFilter implements Filter {
  22.   /** Keep the Filter config. */
  23.   private FilterConfig config;
  24.   /** Set the Filter config. */
  25.   public void init(FilterConfig config) {
  26.     this.config = config;
  27.   }
  28.   /** Preprocesses the request. */
  29.   public void doFilter(ServletRequest request, ServletResponse response,
  30.     FilterChain next) throws IOException, ServletException {
  31.     HttpServletRequest req = (HttpServletRequest)request;
  32.     String style = req.getParameter("style");
  33.     req.setAttribute("caucho.xsl.stylesheet", style);
  34.     next.doFilter(request, response);
  35.   }
  36.   public void destroy() {
  37.   }