2013-05-13 34 views
0

我在Tomcat的7.0.29部署在Web,生成的HttpServletRequest的对象要求, 当我用像初级讲座请求:request.getRemoteUser返回null

String remoteUser=request.getRemoteUser(); 

在remoteuser将是空的。任何方式获得远程使用?

我已经refered到链接 Accessing username with getRemoteUser() when using custom authentication filter,但解决不了这个错误...

+0

'getRemoteUser()''返回时null'用户不认证。 – NINCOMPOOP 2013-05-13 10:16:34

+0

嗨Noob,你会告诉我如何配置获得价值...我已经尝试过,但失败... – Edward 2013-05-13 10:19:30

+1

@爱德华:如果你想要所有的JEE安全功能,需要一些配置。检查http://tomcat.apache.org/tomcat-7.0-doc/realm-howto.html – home 2013-05-13 10:21:56

回答