storing user bean in session

  • Thread starter Chad Cunningham
  • Start date
C

Chad Cunningham

Hi,

I'd like to have a bean populated with data on a user from a database,
then have that bean stored in the session context for easy access on
all of the JSP pages and servlets. The way I'm working this out
currently is to try and use a SessionListener to create the bean when
a session is created (authentication is done with realms in tomcat).

First, is this an appropriate way to handle this or is there a better
way?

Secondly, and I'm probably missing something simple here, but how do I
get ahold of the request object in my SessionListener so that I can
find out what username they logged in with and populate the bean?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,056
Members
48,769
Latest member
Clifft

Latest Threads

Top