The ke开发者_C百科rberos provide authentication control, but I still need to have some user-wise control so I want to get more user information(eg. uid). Thanks.
It's available by HttpServletRequest#getRemoteUser()
.
So, in a servlet it would look like:
String name = request.getRemoteUser();
// ...
In a JSP it would look like:
<p>Welcome, ${pageContext.request.remoteUser}</p>
精彩评论