Class ActiveJdbcFilter

java.lang.Object
org.javalite.activejdbc.web.ActiveJdbcFilter
All Implemented Interfaces:
javax.servlet.Filter

public class ActiveJdbcFilter extends Object implements javax.servlet.Filter
This is a filter for opening a connection before and closing connection after servlet. Example of configuration:

     <filter>
        <filter-name>activeJdbcFilter</filter-name>
        <filter-class>org.javalite.activejdbc.web.ActiveJdbcFilter</filter-class>
        <init-param>
            <param-name>jndiName</param-name>
            <param-value>jdbc/test_jndi</param-value>
        </init-param>
    </filter>
 
Author:
Igor Polevoy
  • Constructor Details

    • ActiveJdbcFilter

      public ActiveJdbcFilter()
  • Method Details

    • init

      public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
      Specified by:
      init in interface javax.servlet.Filter
      Throws:
      javax.servlet.ServletException
    • doFilter

      public void doFilter(javax.servlet.ServletRequest req, javax.servlet.ServletResponse resp, javax.servlet.FilterChain chain) throws IOException, javax.servlet.ServletException
      Specified by:
      doFilter in interface javax.servlet.Filter
      Throws:
      IOException
      javax.servlet.ServletException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface javax.servlet.Filter