fc.web.servlet
Class JDBCAuthFilter

java.lang.Object
  extended by fc.web.servlet.AuthFilter
      extended by fc.web.servlet.JDBCAuthFilter
All Implemented Interfaces:
javax.servlet.Filter

public class JDBCAuthFilter
extends AuthFilter

Implements a simple jdbc based authentication filter. Uses JDBCSession to check for the valid existence of the session ID. The session ID itself is expected to be inside a cookie (the presence of a cookie is checked by invoking LoginServlet.getSIDCookie(javax.servlet.http.HttpServletRequest)

Uses the default database as specified in web.xml and requires JDBCSession to work against that database.


Constructor Summary
JDBCAuthFilter()
           
 
Method Summary
 void init(javax.servlet.FilterConfig config)
           
 boolean isUserLoggedIn(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Checks to see if the session id (sid) exists in the cookie and it that points to a valid (non-expired) database session.
 
Methods inherited from class fc.web.servlet.AuthFilter
destroy, doFilter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCAuthFilter

public JDBCAuthFilter()
Method Detail

init

public void init(javax.servlet.FilterConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Filter
Overrides:
init in class AuthFilter
Throws:
javax.servlet.ServletException

isUserLoggedIn

public boolean isUserLoggedIn(javax.servlet.http.HttpServletRequest req,
                              javax.servlet.http.HttpServletResponse res)
                       throws SQLException
Checks to see if the session id (sid) exists in the cookie and it that points to a valid (non-expired) database session.

Specified by:
isUserLoggedIn in class AuthFilter
Throws:
SQLException