문제

모든 메소드 호출을 모든 솔기 구성 요소에 가로 채어 예외 예외에 도움이 될지 확인하고 싶습니다. 나는 모든 구성 요소와 등록 된 인터셉터의 목록을 가져 와서 그 목록에 원하는 것을 추가 하여이 작업을 수행 할 수 있다고 생각했습니다.

월터

도움이 되었습니까?

해결책

더 높은 우선 순위로 기본 예외 필터를 자신의 것으로 무시하십시오.


@Name("org.jboss.seam.web.exceptionFilter")
@Install(precedence = MOCK, classDependencies="javax.faces.context.FacesContext")
@BypassInterceptors
@Filter(within="org.jboss.seam.web.ajax4jsfFilter")
public class ExceptionFilter extends org.jboss.seam.web.ExceptionFilter

  @Override
  protected endWebRequestAfterException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Exception e)  {
  // here you log exceptions
  }
}

다른 팁

Seam의 예외 처리기를 사용하는 것이 좋습니다. 이것이 당신이 할 수있는 방법입니다.

@Name("org.jboss.seam.exception.exceptions")
@Scope(ScopeType.APPLICATION)
@Install(precedence = Install.APPLICATION)
@BypassInterceptors
public class ExceptionHandler extends org.jboss.seam.exception.Exceptions {

    public void handle(Exception e) throws Exception {
            //Log your exception here if you want 
            Events.instance().raiseAsynchronousEvent("SomeListener",e.getMessage());
    super.handle(e);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top