You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Samir Deolikar <sa...@cisco.com> on 2002/05/22 06:18:14 UTC
Display Remote USER
Hi ALL!
How could I display the Remote User on to the velocity Template.
Regards,
Samir
Re: Display Remote USER
Posted by Gabriel Sidler <si...@teamup.ch>.
Samir,
I assume that your application lives in a Servlet environment:
HttpServletRequest offers method getRemoteUser() to retrieve the login
name of the authenticated user. So, put the request instance into the
context and add the following expression to your template:
$request.getRemoteUser()
Note: This assumes that the request has been added to the context
with key "request"
Note 2: getRemoteUser() returns null if the user is not authenticated.
Gabe
Samir Deolikar wrote:
> Hi ALL!
>
> How could I display the Remote User on to the velocity Template.
>
>
>
> Regards,
>
> Samir
>
--
--
Gabriel Sidler
Software Engineer, Eivycom GmbH, Zurich, Switzerland
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>