有什么区别:
public class GameController implements Serializable{
@ManagedProperty(value="#{Gamebean}")
private Game game;
和
public class GameController implements Serializable{
private Game game;
public GameController(){
game =(Game)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("Gamebean");
}
如果没有区别,哪种方法更好?干杯。