I believe that one of the standard system properties includes the ID of the user that the process is running under. Read the API for java.lang.System.getProperties; I think it lists them there.
I'm not sure if that's what you're looking for, though. In the case of a servlet, this would be the user ID of whatever started the servlet environment. In a real production system this is likely to be "nobody" or an idea with low permissions created specifically for the purpose of running the server. Not sure if that's what you're looking for or how useful that would be to you.
In particular, if you're looking for the ID of the person running the browser that requested the page that the servlet in question is servicing...then you're pretty much out of luck.