[jboss-user] [JBoss Seam] - Re: Success configuring generic filters in SEAM?
pete.muir@jboss.org
do-not-reply at jboss.com
Wed Aug 22 17:44:38 EDT 2007
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).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077077#4077077
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077077
More information about the jboss-user
mailing list