Hi All,
 
I am trying to make a servlet filters, but I found there are two different Filter Interface on my system,
first the interface from sun servlet spec 2.3 looks like this:
 
public abstract void init(FilterConfig filterconfig) throws ServletException;
 
public abstract void doFilter(ServletRequest servletrequest, ServletResponse servletresponse,
    FilterChain filterchain)throws IOException, ServletException;
 
public abstract void destroy();
 
And the second is from OC4J looks like this:
 
public abstract void doFilter(ServletRequest servletrequest, ServletResponse servletresponse,
    FilterChain filterchain) throws IOException, ServletException;
 
public abstract FilterConfig getFilterConfig();
 
public abstract void setFilterConfig(FilterConfig filterconfig);
 
Because currently I'm deploying my app using oc4j I have to follow the oc4j Filter interface, but If I deploy this Filters on the system that have the first Filter above it surely won't work. So how to make this work if we have this difference?
 
If I use the first Filter I will easily get the servlet context from filterconfig in the init method, but to obtain this servlet context from oc4j Filter I have to also extends my class from the HttpServlet, is this a correct way?
 
Regards,
-Wayan-

Reply via email to