从@RequestScope bean获取注入点列表

时间:2015-12-25 14:21:00

标签: jsf cdi

我有value = self.option.get() Position= int(array.index(value)) print(value) #test print(Position) #test file= open("Height_File.txt", "r") Height= file.readline(Position) print(Height)#test file.close() (RequestBean)CDI bean,它被注入两个不同的@RequestScoped JSF @ViewScope'(@ManagedBeanFirstViewBean) 。我想获得RequestBean的注入点列表。我该怎么做?清单如下:

RequestBean:

SecondViewBean

FirstViewBean:

@RequestScoped
public class RequestBean {

    public void logPoints() {
          System.out.println(getInjectionPoints());
    }

    private List<InjectionPoint> getInjectionPoints() {
          List<InjectionPoint> result = null;
          // ...
          return result;
    }
}

SecondViewBean:

@ViewScoped
@ManagedBean
public class FirstViewBean implements Serializable {

    private static final long serialVersionUID = 1867903409268465766L;

    @Inject
    private RequestBean rb;

    public void action() {
          rb.logPoints();
    }
}

0 个答案:

没有答案