Can anybody tell me when does an object of a backing bean(in request scope) get created ?
I have a few components in my jsp page,which have corresponding action listener defined in the backing bean. I have observed that a new instance of my backing bean (i.e the @PostConstruct getting called) is getting created for each events those fired from my UI.
Actually I have a DB call in my init() method which is annotated with @postconstruct.
But this method is getting called for each events that are getting fired and hence calling the DB each time. I want to avoid this.
When ever a JSF page is submited the beans which all are mentioned in the JSf page will be initiated if the bean scope is in request. This is how JSf behave. If bean scope is in session the bean will be intiated for every session.