Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Creating a bean for the session on login

Tim Penhey

2004-05-22

Replies:

In a web-app I have a JDBCRealm and most requests are secure (requiring a logon).

I would like to create a User bean that contains the users first and last name, both of
which are stored in the DB table along with the username and password. I would like to
create this User bean when the user logs on and add it to the session, but I cannot find a
convenitent way to do it.

Using <jsp:useBean> would require a default constructor, but even if I wanted that, I
can't get the request and hence the logged in user.

I looked at HttpSessionListener, but that doesn't seem to have any way to get the logged
in user either.

Ideally I would like to use something that is container independant, but I could go with
something like a filter if that is the only way.

Am I missing something blindingly obvious?

Tim





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.