【问题标题】:Grails, Weblogic and redirection on root "/" seems not workingGrails、Weblogic 和根“/”上的重定向似乎不起作用
【发布时间】:2023-03-27 11:23:01
【问题描述】:

我用这样的根路径(在 UrlMapping 中)配置了我的 grails 应用程序:

"/"{
    controller="mycontroller"
    action="myaction"
 }

在 mycontroller.myaction 中,根据角色,我重定向到正确的操作:

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。

为什么?

你有什么想法吗?

谢谢

【问题讨论】:

    标签: grails weblogic


    【解决方案1】:

    我找到了解决方案here

    • 我创建了一个标签库。
    • 我将“/”上的映射重命名为“/redirect” 网址映射
    • 我在 GSP 中调用 taglib。

    【讨论】:

      猜你喜欢
      • 2012-09-13
      • 1970-01-01
      • 2011-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多