I am starting out with Java EE and have built a simple login system. I first have an EJB project that consists of an Account entity bean that encapsulates a username, first and and a last name. This account entity is manipulated through the AccountFacade, a stateless session bean that allows Accounts to be created, edited, removed and found. The EJB project is included by the web project that features an AccountController that functions as an intermediary between the actual JSF pages and an Account. I have GlassFish setup to do the authentication for me and as such I grab the logged in user in the AccountController as follows:
Having just started out, I was wondering if this was the correct way to:
1) set up your projects (entity beans and session beans in the EJB project and the view and controllers in the web project) like so, and
2) grab the logged in user when you have GlassFish setup to handle authentication for you.
Feedback and constructive criticism very much appreciated!