How to determine username?

I have certain pages of my web app that are protected by username and password. Some things on the page are the same for all users, except I have to only show some links based on the user name. However, I don' tknow how to determine who the user is that logged in.
[279 byte] By [smiles78a] at [2007-10-3 0:02:37]
# 1
try the request.getRemoteUser() method.
tolmanka at 2007-7-14 16:50:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...