|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ora.jsp.servlets.AccessControlFilter
This class provides access control for all requests in the Project Billboard application, by looking for the authentication token in the session and forwarding to the login page if not found.
Field Summary | |
private javax.servlet.FilterConfig |
config
|
private java.lang.String |
loginPage
|
Constructor Summary | |
AccessControlFilter()
|
Method Summary | |
void |
destroy()
Resets the instance variable. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
Looks for the authentication token in the session and forwards to the login page if not found. |
private java.lang.String |
getContextRelativeURI(javax.servlet.http.HttpServletRequest request)
Returns a context-relative path for the request, including the query string, if any. |
private java.lang.String |
getForwardURI(javax.servlet.http.HttpServletRequest request)
Returns the context-relative path to the login page, with the parameters used by the login page. |
void |
init(javax.servlet.FilterConfig config)
Reads the "loginPage" filter init parameter and saves the value in an instance variable. |
private boolean |
isAuthenticated(javax.servlet.http.HttpServletRequest request)
Returns true if the session contains the authentication token. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private javax.servlet.FilterConfig config
private java.lang.String loginPage
Constructor Detail |
public AccessControlFilter()
Method Detail |
public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
- if the "loginPage" parameter is
not set.public void destroy()
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
java.io.IOException
javax.servlet.ServletException
private boolean isAuthenticated(javax.servlet.http.HttpServletRequest request)
private java.lang.String getForwardURI(javax.servlet.http.HttpServletRequest request)
private java.lang.String getContextRelativeURI(javax.servlet.http.HttpServletRequest request)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |