开发者

How to get user name in session bean when redirected to error page?

Can anyone tell 开发者_JAVA技巧me how to get user name in session bean correctly? In our application we do it by calling this method:

@Resource
private EJBContext _context;

private String getUserName() {
    return _context.getCallerPrincipal().getName();
}

And this works fine till everything's fine. But when we get some 500 or 404 error and redirect user to corresponding page (which is set in web.xml) this method returns "WLS KERNEL" as user name. How to get correct user name in this case?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜