Use getUserPrincipal on the servlet request.
on which servlet call,because in my login page action i'm calling j_security_check and we can't write anything in that.please clear my doubt.
thanks in advance,
What you do after the login screen? You should be having a jsp/servlet.
After successful login, you can get this info from your HTTPServletRequest method getUserPrincipal().