避免使用 javax.faces.bean 套件中已淘汰的註釋及介面

此規則會標示使用 javax.faces.bean 套件中已淘汰的介面及註釋。 下列介面及註釋已取代為不同套件中的介面及註釋:

已淘汰的類別

JavaEE8 類別

javax.faces.bean.ApplicationScoped

javax.enterprise.context.ApplicationScoped

javax.faces.bean.CustomScoped

javax.enterprise.context.spi.Context

javax.faces.bean.ManagedProperty

javax.faces.annotation.ManagedProperty

javax.faces.bean.NoneScoped

javax.enterprise.context.Dependent

javax.faces.bean.RequestScoped

javax.enterprise.context.RequestScoped

javax.faces.bean.SessionScoped

javax.enterprise.context.SessionScoped

javax.faces.bean.ViewScoped

javax.faces.view.ViewScoped

javax.faces.bean.ManagedBean 已取代為一般的受管理 Bean 規格,特別是 CDI 規格中的相依關係注入、範圍及命名。 請注意,應用程式範圍 Bean 的盲目型屬性會特別被取代,請觀察 javax.enterprise.context.Initialized 事件 javax.enterprise.context.ApplicationScoped .

沒有直接替代 javax.faces.bean.ReferencedBean 除了在 faces-config.xml 中使用 XML 變式之外