Re: Obtain username from J_security_check
Gareth Jones <[email protected]>
| Newsgroups | gmane.comp.java.sun.servlet |
|---|---|
| Message-ID | <[email protected]> |
Alternatively try: getUserPrincipal().getName() which returns a java.security.Principal object containing the name of the current authenticated user. If the user has not been authenticated, the method returns null. >From: "Chan, Christopher" <[email protected]> >Reply-To: "A mailing list for discussion about Sun Microsystem's Java > Servlet API Technology." <[email protected]> >To: [email protected] >Subject: Re: Obtain username from J_security_check >Date: Fri, 7 Mar 2003 07:40:41 +1100 > >Use the following to get the user: request.getRemoteUser(); > >Rgds, >Chris >-----Original Message----- >From: Richard Masters [mailto:[email protected]] >Sent: Thursday, 6 March 2003 20:22 PM >To: [email protected] >Subject: Obtain username from J_security_check > > >Hello all, > >Im not sure if this is the correct mailing list for this question as it >relates to the servlet container more than anything. >I use "j_security_check" to allow users to log in to my website, and I >would >like to know how I can obtain the username of those who are successfully >logged on. > >I have tried: > >String usrnme = request.getParameter("j_username"); > >but this returns null. > >Can anyone help > >Thanks in advance >Richard > >_________________________________________________________________ >Surf together with new Shared Browsing >http://join.msn.com/?page=features/browse&pgmarket=en-gb&XAPID=74&DI=1059 > >___________________________________________________________________________ >To unsubscribe, send email to [email protected] and include in the body >of the message "signoff SERVLET-INTEREST". > >Archives: http://archives.java.sun.com/archives/servlet-interest.html >Resources: http://java.sun.com/products/servlet/external-resources.html >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > >___________________________________________________________________________ >To unsubscribe, send email to [email protected] and include in the body >of the message "signoff SERVLET-INTEREST". > >Archives: http://archives.java.sun.com/archives/servlet-interest.html >Resources: http://java.sun.com/products/servlet/external-resources.html >LISTSERV Help: http://www.lsoft.com/manuals/user/user.html _________________________________________________________________ Worried what your kids see online? Protect them better with MSN 8 http://join.msn.com/?page=features/parental&pgmarket=en-gb&XAPID=186&DI=1059 ___________________________________________________________________________ To unsubscribe, send email to [email protected] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html