我在 NetBeans 8.1 中使用了 grails 3.1.X。安全插件无法解析使用过的注释。下面的代码:
package securityplugintest
//import grails.plugins.springsecurity.Secured
import grails.plugin.springsecurity.annotation.Secured //not esolved
@Secured(['ROLE_USER']) //not resolved
class ProductAnnouncementController {
def index() {
def announcements = ProductAnnouncement.createCriteria().list {
order("dateCreated", "desc")
maxResults(1)
}
render announcements.first()?.message
//render announcements.any()?.meassage
}
}
在 NetBeans 中,我将 Grails 3.1.11 和spring-security
插件配置为
dependencies {
compile 'org.grails.plugins:spring-security-core:3.0.3'
}
我正在遵循本手册并在最后一步出现错误。