【发布时间】:2016-06-25 09:55:08
【问题描述】:
我正在查看 grails spring security core v3 的文档。 Grails Spring Security Plugin v3 我的目标是在 yml 文件中配置 url 映射,而不是分散在整个代码中。他们的文件说,要做到这一点,我们必须做两件事。首先,设置
securityConfigType: 'InterceptUrlMap'
然后按以下格式概述我们的模式:
grails.plugin.springsecurity.interceptUrlMap = [
[pattern: '/', access: ['permitAll']]
]
所以我在下面的代码中做到了这一点:(注意,这是从他们的文档中复制和粘贴的)
grails:
plugin:
springsecurity:
securityConfigType: 'InterceptUrlMap'
interceptUrlMap: [
[pattern: '/', access: ['permitAll']],
[pattern: '/error', access: ['permitAll']],
[pattern: '/index', access: ['permitAll']],
[pattern: '/index.gsp', access: ['permitAll']],
[pattern: '/shutdown', access: ['permitAll']],
[pattern: '/assets/**', access: ['permitAll']],
[pattern: '/**/js/**', access: ['permitAll']],
[pattern: '/**/css/**', access: ['permitAll']],
[pattern: '/**/images/**', access: ['permitAll']],
[pattern: '/**/favicon.ico', access: ['permitAll']],
[pattern: '/login/**', access: ['permitAll']],
[pattern: '/logout/**', access: ['permitAll']]
]
但是,当尝试使用新建的 war 文件访问我的网页时,我收到一条错误消息:
groovy.lang.MissingMethodException: No signature of method: grails.plugin.springsecurity.ReflectionUtils$_splitMap_closure5.doCall() is applicable for argument types: (java.util.ArrayList) values: [[[pattern:/], [access:[permitAll]]]]
Possible solutions: doCall(java.util.Map), findAll(), findAll(), isCase(java.lang.Object), isCase(java.lang.Object)
我不确定这里的问题是什么。如果我让 grails 3.0 使用 s2-quickstart 生成的 groovy 脚本,一切都会按预期工作。但是,考虑到我的其他配置 100% 都在 YML 文件中,我当然不想走那条路。
我是否在这里遗漏了一些需要设置的明显属性?
【问题讨论】: