Grails, Weblogic and redirection on root “/” seems not working

落爺英雄遲暮 提交于 2019-11-30 19:35:50

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!