如何为spring boot项目只签入会话侦听器?

如何为spring boot项目只签入会话侦听器?,spring,spring-boot,Spring,Spring Boot,我有一些控制器用于用户更新、文章更新、删除等 我不想在controller中检查会话,当用户尝试更新文章时,用户只能更新自己的文章 所以,我试图在拦截器中处理这个动作,但这种方法将拦截器和控制器耦合起来 目前,我正在检查用户操作,如下所示 String param = request.getParameter("id"); // A user accesses his own resource. ((String)session.getAttribute("key")).eqauls(para

我有一些控制器用于用户更新、文章更新、删除等

我不想在controller中检查会话,当用户尝试更新文章时,用户只能更新自己的文章

所以,我试图在拦截器中处理这个动作,但这种方法将拦截器和控制器耦合起来

目前,我正在检查用户操作,如下所示

String param = request.getParameter("id");

// A user accesses his own resource.
((String)session.getAttribute("key")).eqauls(param) == true
String param2 = request.getParameter("email");
// here, i have to add some logic to find the id using email.
....
但是,当请求参数不直接使用
id
时, 我必须添加一些声明,如以下

String param = request.getParameter("id");

// A user accesses his own resource.
((String)session.getAttribute("key")).eqauls(param) == true
String param2 = request.getParameter("email");
// here, i have to add some logic to find the id using email.
....

为什么不使用Spring Security?我还没有学会Spring Security。