You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by amit varshney <am...@sify.com> on 2004/03/01 06:32:50 UTC

Need Help in Session Management !!!

I want to use  tomcat user authentication in my application. for that i am using JDBCRealm.I have set the security constraint in the web.xml. So when  a request for the restricted page comes a login page comes.
 But the problem is that it is submitting to the j_security_check and the textboxes are named j_username and j_password respectivley.I want session mangemant in my application. For that I need the login name of the person on my each page. How can I pass the username from login page to my page. is it possible to maintain session using tomcat user authentication or should i go for my own authentication and session management.

Plz help me 
Thanks in advance 
Amit Varshney

-------------------------------------------------
Still single? Click here to find the perfect match.
                                                                                
http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?141

Re: Need Help in Session Management !!!

Posted by shanmugampl <sh...@adventnet.com>.
I think you can get the user name by getting the Principal object from 
request and then getting the name from it like

String userName = request.getUserPrincipal().getName();

-Shanmugam-

amit varshney wrote:

>I want to use  tomcat user authentication in my application. for that i am using JDBCRealm.I have set the security constraint in the web.xml. So when  a request for the restricted page comes a login page comes.
> But the problem is that it is submitting to the j_security_check and the textboxes are named j_username and j_password respectivley.I want session mangemant in my application. For that I need the login name of the person on my each page. How can I pass the username from login page to my page. is it possible to maintain session using tomcat user authentication or should i go for my own authentication and session management.
>
>Plz help me 
>Thanks in advance 
>Amit Varshney
>
>-------------------------------------------------
>Still single? Click here to find the perfect match.
>                                                                                
>http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?141
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org