Getting the URL of the current page in Grails

前端 未结 5 1100
深忆病人
深忆病人 2020-12-14 17:23

In a Grails application I\'d like to send a user from page A, then to a form on page B and then back to page A again.

To keep track of which URL to return to I send

5条回答
  •  离开以前
    2020-12-14 17:37

    I prefer to use:

    createLink(action: "index", controller:"user", absolute: true)
    // http://localhost:8080/project/user
    

    when I need to get an absolute url!

    It's interesting to get relative path too:

    createLink(action: "index", controller:"user")
    // /project/user
    

提交回复
热议问题