@Secured on Spring controllers and context mess -
@Secured on Spring controllers and context mess -
for web mvc need @ to the lowest degree 2 configs: dispatcher-servlet.xml
, applicationcontext.xml
. utilize next filter security:
<filter> <filter-name>springsecurityfilterchain</filter-name> <filter-class>org.springframework.web.filter.delegatingfilterproxy</filter-class> </filter> <filter-mapping> <filter-name>springsecurityfilterchain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
this filter needs springsecurityfilterchain
, defined in applicationcontext.xml
<security:http />
however, want utilize @secured
annotation on @controller
, defined in dispatcher-servlet.xml
. again, needs <security:http />
- in context file!
all i'm trying accomplish security on @controller
level. don't care securing deeper layers (@service
etc.) @ since entry point.
what way out of mess? doing wrong?
to enable security annotations controllers need add together <security:global-method-security ... />
dispatcher-servlet.xml
. other security-related stuff stays in applicationcontext.xml
.
spring spring-mvc spring-security
Comments
Post a Comment