在Grails应用程序中无法解析org.springframework.security.web.FilterChainProxy类型

时间:2015-03-26 15:52:45

标签: grails spring-security

我正在尝试在Grails-application中编写LogoutController。我找到了一个有效的代码:

package myPackage

import grails.plugin.springsecurity.SpringSecurityUtils
import grails.plugin.springsecurity.annotation.Secured

import javax.servlet.http.HttpServletResponse
@Secured('permitAll')
class LogoutController {
    def index() { 
        if (!request.post && SpringSecurityUtils.getSecurityConfig().logout.postOnly) {
            response.sendError HttpServletResponse.SC_METHOD_NOT_ALLOWED
            return
            }

            // TODO put any pre-logout code here

            redirect uri: SpringSecurityUtils.securityConfig.logout.filterProcessesUrl
    }
}

但是“package myPackage”字符串中出现语法错误:The type org.springframework.security.web.FilterChainProxy cannot be resolved. It is indirectly referenced from required .class files

我尝试配置构建路径,我在“订购和导出”列表中标记了所有内容(我在Grails Tool Suite中工作(基于eclipse)),但都不成功。怎么解决?

1 个答案:

答案 0 :(得分:0)

解决。有些奇怪,但应用程序可以正确处理该错误。