FileDocCategorySizeDatePackage
SecurityFilter.javaAPI DocExample1019Sat Mar 15 19:39:50 GMT 2003com.oreilly.javaxp.cactus.filter

SecurityFilter

public class SecurityFilter extends Object implements Filter
author
Brian M. Coyner $version $Id: SecurityFilter.java,v 1.3 2003/02/27 00:24:43 jepc Exp $

Fields Summary
Constructors Summary
Methods Summary
public voiddestroy()

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


        System.out.println("SecurityFilter.doFilter");
        Principal principal = ((HttpServletRequest) req).getUserPrincipal();
        if (principal == null) {
            req.setAttribute("errorMessage", "You are not logged in!");
            req.getRequestDispatcher("/login.jsp").forward(req, res);
        } else {
            chain.doFilter(req, res);
        }
    
public voidinit(javax.servlet.FilterConfig config)