Good morning, i have a use-case in my project that says that If the user isn't logged in to the application display a warning message to him
and what determines if the user is logged in or not is a managed bean called loginPageCode
, a class in the business logic layer will be responsible to determine if the user is logged in or not in order to take a decision for displaying a message(that action will be taken when a specific action occurs in a JSF page called home.jsf
), i thought of 2 approaches to do that as follows:
- Make the home page determine if the user is logged in or not and pass the final decision to the business logic class
- Make the business logic class be responsible for determining if the user is logged in or not and that will require it to deal directly with
loginPageCode
i want to know the suitable way of doing that from the point of design.