i search a way how i can access a class in the sessionscope.
I have this class:
@ManagedBean
@SessionScoped
public class UserManagerBean implements Serializable{...}
and i will access some fields from a other bean. How can i do this?
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do that by taking the bean as a
@ManagedPropertyof the other bean and then just access it as an usual property in the action methods.It will be set directly after construction, so it wouldn’t be available in the constructor. If you’d like to do some init stuff which relies on its availablility, then make use of
@PostConstruct: