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