1

我有一个使用 Spring 3.* 的 Web 应用程序,并且我的 Web 应用程序中有一个 Flash 组件需要 POST 到 Servlet。在 Servlet 的 doPost 方法中,我想检查 Spring 应用程序上下文以确保存在经过身份验证的会话,这可能吗?

4

1 回答 1

3

那么它很简单,只需使用

Authentication auth = SecurityContextHolder.getContext().getAuthentication();
于 2012-05-02T07:13:55.943 回答