|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.p13n.servlets.PortalServletFilter
Filters can interact with external resources. In this case, we associate the filter with the Servlet (see web.xml) so that, each time the servlet is called, this filter checks for user logins. If found, it delegates to the SessionHelper for profile swapping into/out of Session, firing events, tagging a logged in user via a Session attribute.
Configure this filter in web.xml as follows:
Field Summary | |
protected boolean |
createAnonymousProfile
|
protected boolean |
createNewProfile
If not tracking anonymous, and if not using anonynomus, then we don't create a new profile wrapper. |
protected String |
defaultSkipPattern
|
protected boolean |
fireLoginEvent
Init parameters set in web.xml, default values |
protected String |
skipRequestPattern
Patterns in the request that will cause us to bypass this request. |
protected boolean |
trackAnonymousUsers
|
Constructor Summary | |
PortalServletFilter()
|
Method Summary | |
protected ProfileType |
checkProfileType(ProfileWrapper profile,
HttpServletRequest request,
HttpServletResponse response)
Check that we're dealing with the right profile type |
void |
destroy()
|
void |
doFilter(ServletRequest req,
ServletResponse res,
FilterChain chain)
Called when the servlet associated with this filter is invoked. |
protected void |
doTrackAnonymousUsers(ProfileWrapper profile,
HttpServletRequest request,
HttpServletResponse response)
If we're tracking anonymous users, more to be done. |
FilterConfig |
getFilterConfig()
Required by Filter interface |
void |
init(FilterConfig fc)
The init method is called by the container when the filter is instantiated. |
void |
setFilterConfig(FilterConfig fc)
Required by Filter interface |
protected void |
setSkipRequests(String noDo)
Construct the list of requests we're going to ignore |
protected void |
showHeaders(HttpServletRequest request)
Debug purposes, show headers |
protected void |
showRequest(HttpServletRequest request)
Debug purposes, show info about request |
protected boolean |
skipRequest(HttpServletRequest request)
Determine wheter we're going to skip this request |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected boolean createAnonymousProfile
protected boolean createNewProfile
protected String defaultSkipPattern
protected boolean fireLoginEvent
protected String skipRequestPattern
protected boolean trackAnonymousUsers
Constructor Detail |
public PortalServletFilter()
Method Detail |
protected ProfileType checkProfileType(ProfileWrapper profile, HttpServletRequest request, HttpServletResponse response) throws ServletException
ServletException
public void destroy()
destroy
in interface Filter
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException
doFilter
in interface Filter
IOException
ServletException
protected void doTrackAnonymousUsers(ProfileWrapper profile, HttpServletRequest request, HttpServletResponse response) throws Exception
Exception
public FilterConfig getFilterConfig()
public void init(FilterConfig fc) throws ServletException
PortalServletFilter
com.bea.p13n.servlets.PortalServletFilter
skipRequestPattern
/css/, /js/, /image/, /wlwdir
Skip over these type of requests (no profile manipulation). Pattern is glob-style. This entry is REQUIRED.
fireSessionLoginEvent
false
Option to fire SessionLoginEvent , defaults to false if not set
createAnonymousProfile
true
Create an anonymous profile for every session. Defaults to true seconds if not set
enableTrackedAnonymous
false
Option to track anonymous users , defaults to false if not set. 'createAnonymousProfile' is ignored if this is true
trackedAnonymousVisitDuration
5
Length in seconds visitor must be on site before we start tracking them . Defaults to 60 seconds if not set
init
in interface Filter
ServletException
public void setFilterConfig(FilterConfig fc)
protected void setSkipRequests(String noDo)
protected void showHeaders(HttpServletRequest request)
protected void showRequest(HttpServletRequest request)
protected boolean skipRequest(HttpServletRequest request)
|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |