-
1. Re: How to initiate a list
snaker May 31, 2011 12:20 PM (in response to pankajjain_1510)in the constructor of bean, you can initialize arraylist
-
2. Re: How to initiate a list
pankajjain_1510 May 31, 2011 12:39 PM (in response to snaker)Thanks for your reply.. I did that but another problem stroke at that time. UserBean is class , a managed bean, which handles login and logout action as well. When there is login no problem occurs as it's instance is already created and ready for further navigation . But when log out action has been fired I have to remove UserBean's instance from session using following code
HttpServletRequest req = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
req.getSession().removeAttribute("UserBean");
So when UserBean is being removed a topic list is already associated with it is also get removed. After log out , index page should appear with topic list and login page as I described earlier. So How can I achieve log out action then .............
-
3. Re: How to initiate a list
snaker Jun 1, 2011 3:52 AM (in response to pankajjain_1510)try include the list in postconstructor:
@PostConstruct
System.out.println("Works"
);}
This way, always the bean is created this function is executed