package hompage
import logindetails.*
import login.User
import grails.plugins.springsecurity.Secured;
class RedirectController
{
def springSecurityService
def index() { }
/**
* This method will redirect the user if it has the role "ROLE_ADMIN"
*/
@Secured(['ROLE_ADMIN'])
def adminhomepage =
{
render(view: "adminhome")
}
/**
* This method will redirect the user if it has the role "ROLE_USER"
*/
@Secured(['ROLE_USER'])
def userhomepage=
{
render(view: "userhome")
}
}
這是我的代碼,我想重定向到adminhome當且僅當角色是ROLE_ADMIN和USERHOME如果該角色ROLE_USER。Grails的春季安全插件@Secured標註不解決
請幫我執行這段代碼。
我使用NetBeans IDE,並有進口進口grails.plugins.springsecurity.Secured
unable to resolve class grails.plugins.springsecurity.Secured @ line 5, column 1.
即使(通常表明Java代碼就像紅色感嘆號)警告進口是目前我沒有得到它是什麼問題?
入住這裏http://stackoverflow.com/questions/19877725/grails-spring-core-security-plugin-unable-to-resolving-classes – akaashanky