Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Proper way to identify user  RSS feed

Henk van der Laar
Posts: 1
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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!

It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!