This content has been marked as final.
Show 1 reply
-
1. Re: Success configuring generic filters in SEAM?
pmuir Aug 22, 2007 5:44 PM (in response to rmcfadden94)This is much easier in Seam2, if you can use it...
@Scope(APPLICATION) @Name("myFilter") @BypassInterceptors @Filter(within="org.jboss.seam.web.ajax4jsfFilter") public class MyFilter extends AbstractFilter { public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { new ContextualHttpServletRequest( (HttpServletRequest) request ) { public void process() throws ServletException, IOException { // Do your work } }.run(); } }
If you are stuck on Seam 1.2, then you don't havve @Filter and you don't have ContextualHttpServletRequest, so mark your filter with @Name and @Startup, and do the Lifecycle setup and teardown yourself (look at filters in org.jboss.seam.web for how to do this).
You can configure it using components.xml as usual (just add getters and setters).