向grails请求添加时间戳

向grails请求添加时间戳,grails,Grails,我想在grails中为我的一个请求添加一个时间戳。我该怎么办呢。 在url末尾添加时间戳的原因是为了防止在浏览器中缓存 class UrlMappings { static mappings = { "/$controller/$action?/$id?"{ constraints { // apply constraints here } } "/"(controller: "main") "/buil

我想在grails中为我的一个请求添加一个时间戳。我该怎么办呢。 在url末尾添加时间戳的原因是为了防止在浏览器中缓存

class UrlMappings {
  static mappings = {
    "/$controller/$action?/$id?"{
        constraints {
            // apply constraints here
        }
    }
    "/"(controller: "main")
    "/build/onetime/place"(controller: "main", action: "placeInAction")
}
我想把时间戳加在这个上面

"/build/onetime/place"(controller: "main", action: "placeInAction")

如果只想添加时间戳以避免缓存,则不需要在
UrlMapping
中映射它,只需将其作为查询参数附加到url即可


请看一下这一点,以获得清晰的图像。

您所说的时间戳实际上是什么意思?详细说明一个用例会很有用。你的问题很不清楚。。。为了得到相关的答案,你必须能够清楚地解释你的问题是什么。时间戳通常用在url的末尾,以防止在浏览器中缓存。