I have the following snippet on the home page of my app:
<h:panelGroup rendered="#{loginBean.loggedIn}">
<p>Welcome, #{loginBean.currentUser.firstName}</p>
</h:panelGroup>
LoginBean is @SessionScoped
. Since it is being referred to on the home page, an instance of the same will be created when the page loads.
Now, assume that the user never logs in. In that case, my LoginBean is of no use since it won't be holding any information about the user. Wouldn't this be redundant?
Am not saying that this causes problems, but am just wondering about the unnecessary instantiation taking up memory space.