spring not enforcing method security annotations

后端 未结 7 1129
心在旅途
心在旅途 2021-01-01 20:05

I\'m some what lost as to why spring isn\'t enforcing the @Secured(\"ROLE_USER\") on my service interface. My controllers are established using annotations.

An exam

相关标签:
7条回答
  • 2021-01-01 20:38

    I had this same problem. Using the information from Kent Lai's reply here, I was able to fix it.

    I put the <global-method-security> element in my app-servlet.xml but kept the security definitions separate in security.xml, where web.xml has contextConfigLocation for app-servlet.xml and security.xml.

    Works like a charm now!

    0 讨论(0)
提交回复
热议问题