com.opensymphony.webwork.dispatcher
Class FilterDispatcherCompatWeblogic61

java.lang.Object
  extended by com.opensymphony.webwork.dispatcher.FilterDispatcher
      extended by com.opensymphony.webwork.dispatcher.FilterDispatcherCompatWeblogic61
All Implemented Interfaces:
WebWorkStatics, Filter

public class FilterDispatcherCompatWeblogic61
extends FilterDispatcher
implements Filter

When running Weblogic Server 6.1, this class should be specified in web.xml instead of FilterDispatcher.

This class properly handles the weblogic.jar handling of servlet filters. There is one serious incompatibility, and that is that while FilterDispatcher.init(FilterConfig) throws a ServletException, this class's method setFilterConfig(FilterConfig) does not throw the exception. Since setFilterConfig(FilterConfig) invokes FilterDispatcher.init(FilterConfig), the setter must "swallow" the exception. This it does by logging the exception as an error.

Version:
$Id: FilterDispatcherCompatWeblogic61.java 2339 2006-03-08 20:28:56Z rainerh $
Author:
Scott N. Smith scottnelsonsmith@yahoo.com

Field Summary
 
Fields inherited from class com.opensymphony.webwork.dispatcher.FilterDispatcher
filterConfig, pathPrefixes
 
Fields inherited from interface com.opensymphony.webwork.WebWorkStatics
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER
 
Constructor Summary
FilterDispatcherCompatWeblogic61()
           
 
Method Summary
 FilterConfig getFilterConfig()
          This method is required by Weblogic 6.1 SP4 because they defined this as a required method just before the Servlet 2.3 specification was finalized.
protected  ServletContext getServletContext(HttpSession session)
          answers the servlet context.
 void setFilterConfig(FilterConfig filterConfig)
          dummy setter for FilterDispatcher.filterConfig; this method sets up the ServletContextSingleton with the servlet context from the filter configuration.
 
Methods inherited from class com.opensymphony.webwork.dispatcher.FilterDispatcher
afterActionInvocation, beforeActionInvocation, checkUrl, copy, createComponentManager, destroy, doFilter, findInputStream, findStaticResource, init, parse, setupContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.Filter
destroy, doFilter, init
 

Constructor Detail

FilterDispatcherCompatWeblogic61

public FilterDispatcherCompatWeblogic61()
Method Detail

setFilterConfig

public void setFilterConfig(FilterConfig filterConfig)
dummy setter for FilterDispatcher.filterConfig; this method sets up the ServletContextSingleton with the servlet context from the filter configuration.

This is needed by Weblogic Server 6.1 because it uses a slightly obsolete Servlet 2.3-minus spec whose Filter interface requires this method.

Parameters:
filterConfig - the filter configuration.

getServletContext

protected ServletContext getServletContext(HttpSession session)
answers the servlet context.

Servlet 2.3 specifies that this can be retrieved from the session. Unfortunately, weblogic.jar can only retrieve the servlet context from the filter config. Hence, this returns the servlet context from the singleton that was setup by setFilterConfig(FilterConfig).

Overrides:
getServletContext in class FilterDispatcher
Parameters:
session - the HTTP session. Not used
Returns:
the servlet context.

getFilterConfig

public FilterConfig getFilterConfig()
This method is required by Weblogic 6.1 SP4 because they defined this as a required method just before the Servlet 2.3 specification was finalized.

Overrides:
getFilterConfig in class FilterDispatcher
Returns:
the filter's filter configuration

WebWork Project Page