Getting a GET request param into an @ViewScoped bean
I have a (request-scoped) list from which the user may select a "PQ" (list of links). When clicked or otherwise entered into the browser the main page for each PQ shall be displayed. Each PQ's page is of the form http://localhost:8080/projectname/main.jsf?id=2 Here's the PQ bean first: @Named @ViewScoped public class PqHome implements Serializable { @PersistenceContext(unitName="...") private EntityManager em; private Integer id; private PQ instance; @PostConstruct public void init() { System.out.println("ID is " + id); // ID from URL param instance = em.find(PQ.class, id); } public Integer