FileDocCategorySizeDatePackage
LogFilter.javaAPI DocExample945Thu Sep 19 18:37:46 BST 2002com.oreilly.javaxp.cactus.filter

LogFilter

public class LogFilter extends Object implements Filter
author
Brian M. Coyner $version $Id: LogFilter.java,v 1.2 2002/09/19 01:21:55 jepc Exp $

Fields Summary
Constructors Summary
Methods Summary
public voiddestroy()

    
public voiddoFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse res, javax.servlet.FilterChain chain)


        Principal principal = ((HttpServletRequest) req).getUserPrincipal();
        if (principal == null) {
            req.setAttribute("errorMessage", "Please Login");
            req.getRequestDispatcher("/login.jsp").forward(req, res);
        } else {
            chain.doFilter(req, res);
        }
    
public voidinit(javax.servlet.FilterConfig config)