KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > webapp > filter > ContextFilter


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