私のMVCアプリケーションでは、プリンシパルオブジェクトを取得しようとしてログインした後でも、
Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
認証は null として返されます。
Spring セキュリティのコンテキストでは、
<intercept-url pattern="/test/user/login" access="IS_AUTHENTICATED_ANONYMOUSLY" />
Web.xml でのサーブレット マッピング:
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
私はMVCの実装が初めてです。これを修正するのを手伝ってください。