问题
I configured my grails application with an root path like this (in UrlMapping):
"/"{
controller="mycontroller"
action="myaction"
}
in mycontroller.myaction, depending of the role, I redirect to the right action :
def link
if (SpringSecurityUtils.ifAnyGranted("ROLE_ADMIN") link = g.createLink(action: "action1", controller:"controller")
else if (SpringSecurityUtils.ifAnyGranted("ROLE_ADMIN") link = g.createLink(action: "action2", controller:"controller")
else ...ANONYMOUS... {
link = g.creatLink(action:"public", controller:"mycontroller")
}
redirect (url:link)
With embedded grails server, it's working fine but with weblogic it redirect on the index.gsp.
Why ?
Do you have an idea ?
Thanks
回答1:
I found the solution here
- I created a taglib.
- I rename the mapping on "/" to "/redirect" in UrlMapping
- I call the taglib in GSP.
来源:https://stackoverflow.com/questions/6190651/grails-weblogic-and-redirection-on-root-seems-not-working