Grails、Weblogic 和根目录“/"重定向似乎不起作用 [英] Grails, Weblogic and redirection on root "/" seems not working
本文介绍了Grails、Weblogic 和根目录“/"重定向似乎不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用这样的根路径(在 UrlMapping 中)配置了我的 grails 应用程序:
I configured my grails application with an root path like this (in UrlMapping):
"/"{
controller="mycontroller"
action="myaction"
}
在 mycontroller.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)
使用嵌入式 grails 服务器,它工作正常,但使用 weblogic 它重定向到 index.gsp.
With embedded grails server, it's working fine but with weblogic it redirect on the index.gsp.
为什么?
你有什么想法吗?
谢谢
推荐答案
我找到了解决方案 这里
- 我创建了一个标签库.
- 我将/"上的映射重命名为/redirect"网址映射
- 我在 GSP 中调用 taglib.
这篇关于Grails、Weblogic 和根目录“/"重定向似乎不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文