The way I always do it is I create a User (with email, fullName, etc.) class
which is mapped into my database to the same tables I instruct Tomcat to use
for a JdbcRealm. Then, I set up a filter which makes sure that a User
object exists when there is a user principal. You can use the
request.getUserPrincipal().getName() to find out the username of the logged
in user. In your filter, you do something like...
User user = ( User )request.getSession().getAttribute( "user" );
if( user == null && request.getUserPrincipal() != null )
{
user = UserDao.getUserByName( request.getUserPrincipal().getName() );
request.setAttribute( "user", user );
}
Hope this helps!
----- Original Message -----
From: "Mike Duffy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 23, 2003 8:10 AM
Subject: Problem with Bookmarking a Login Page
> Does anyone know of a Struts work around for the problem with Tomact
> in bookmarking the login page for container managed security?
>
> There was a brief thread on this issue about a month ago
> [http://www.mail-archive.com/[EMAIL PROTECTED]/msg59734.html]
>
> There is a SourceForge project called SecurityFilter that can be used
> to replace Tomcat's container managed security, but it would be nice
> to be able to work with Tomcat.
>
> Has anyone tried to call "j_security_check" directly from an Action
> class? Once you can authenticate a user you would be able to get the
> roles for that user.
>
> Is there a way to set up a JDBC Realm purely in Struts? I did not see
> any information on this in a quick scan of the documentation.
>
> Hopefully, the good people working on Tomcat see this as a bug that
> needs to be fixed.
>
> Quote from a recent thread in the Tomcat news group: "I wish that
> there was a legitimate configuration change to enable you to bookmark
> a login.jsp page--such as a j_success_url parameter which instructs
> Tomcat where to send users if not doing an automated login process."
>
> Another user stated, "...I simply just can't believe that there are
> Tomcat instances out there in a live production environment with
> configured realms that suffer from this problem. Surely there must be
> something...."
> http://www.mail-archive.com/[EMAIL PROTECTED]/msg77974.html
>
> Thanks.
>
> Mike
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
> http://platinum.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]