spring-security配置security:http 发表于 2016-02-04 | 分类于 spring-security实战 | 配置security:http有两种方式,视情况选用。 第一种:123<security:http auto-config="true" use-expressions="true"> <security:intercept-url pattern="/*" access="hasRole('ROLE_USER')"/></security:http> 第二种:123<security:http auto-config="true" use-expressions="false"> <security:intercept-url pattern="/*" access="ROLE_USER"/></security:http> 说明: use-expressions 1.true access属性要使用表达式 2.false access属性不能使用表达式