@Intertceptors does not work for web bean for JSF page.

Posted by Drevlyanin on Stack Overflow See other posts from Stack Overflow or by Drevlyanin
Published on 2010-04-22T13:07:31Z Indexed on 2010/04/22 13:43 UTC
Read the original article Hit count: 188

Filed under:
|
|
@Named
@ConversationScoped
@Interceptors(MyInterceptor.class)
public class BeanWeb implements Serializable {
    public String methodThrowException throws Exception() {
        throws new Exception();
    }
}

public class MyInterceptor {
    @AroundInvoke
    public Object intercept(InvocationContext ic) throws Exception {
        try {
            return ic.proceed();
        } catch (Exception e) {
            return null;
        }
    }
}

For @Stateless beans interceptor works, but for the BeanWeb interceptor does not work. And we have never entered into "intercept" method.

  1. Why is this happening?
  2. How could intercept method calls in BeanWeb?

P.S.: All this spin under Glassfish 3.x.

© Stack Overflow or respective owner

Related posts about java

Related posts about java-ee