All pastes #2126403 Raw Edit

ViewScoped not working

public java v1 · immutable
#2126403 ·published 2012-03-09 14:36 UTC
rendered paste body
/* Relevant imports: */import java.io.Serializable;import java.util.List; import javax.annotation.PostConstruct;import javax.ejb.EJB;import javax.ejb.PrePassivate;import javax.ejb.Stateful;import javax.faces.application.FacesMessage;import javax.faces.bean.ViewScoped;import javax.faces.context.FacesContext;import javax.inject.Named; /* relevant excerpt of the class */ @Stateful@ViewScoped@Named("insightEdit")public class A implements Serializable {     /* .... */    public A() {    }     @PostConstruct    public void initialize() {        Long id = null;             System.out.println("Initializing A...");        try {            id = Long.parseLong(FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id"));						/* ...*/        } catch (final Exception e) {            /*...*/        }    }     @PrePassivate    public void destroy() {        System.out.println("PrePassivate");    } /* ... */}