且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

不会调用具有@Named @ViewScoped的@PostConstruct拦截器

更新时间:2023-12-03 19:47:34

您应将@PostConstruct拦截器的返回类型设置为void而不是Object. 更改:

You should set return type of @PostConstruct interceptor to void not Object. Change:

  @PostConstruct
  public Object logPostConstruct(InvocationContext invocationContext) throws Exception
  {...}

收件人:

  @PostConstruct
  public void logPostConstruct(InvocationContext invocationContext) throws Exception
  {...}