How to get Value from FacesContext in JSF?
If your managed bean is testbean of class TestBean then U can get the bean from the FacesContex based on scope as followsFor session scope---
TestBean testbeanObject=(TestBean)FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("testbean");
For Request scope---
TestBean testbeanObject=(TestBean)FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("testbean");
For Application scope---
TestBean testbeanObject=(TestBean)FacesContext.getCurrentInstance().getExternalContext().getApplicationMap().get("testbean");
No comments:
Post a Comment