1 package org.jbpm.webapp.filter; 2 3 import java.io.IOException ; 4 5 import javax.servlet.Filter ; 6 import javax.servlet.FilterChain ; 7 import javax.servlet.FilterConfig ; 8 import javax.servlet.ServletException ; 9 import javax.servlet.ServletRequest ; 10 import javax.servlet.ServletResponse ; 11 12 import org.jbpm.webapp.context.Context; 13 14 public class ContextFilter implements Filter { 15 16 public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException , ServletException { 17 try { 18 Context.create(); 19 filterChain.doFilter(servletRequest, servletResponse); 20 } finally { 21 Context.destroy(); 22 } 23 } 24 25 public void init(FilterConfig filterConfig) throws ServletException { 26 } 27 28 public void destroy() { 29 } 30 } 31 | Popular Tags |