开发者

Adding UrlMapping constraints to a VERB-mapped url?

开发者 https://www.devze.com 2023-02-18 05:54 出处:网络
Is it possible to add constraints to HTTP verb-matched Url Mappings? Here\'s开发者_开发技巧 my current definition:

Is it possible to add constraints to HTTP verb-matched Url Mappings?

Here's开发者_开发技巧 my current definition:

    "/a/$param1/b" {
        controller = "a"
        action = [GET: 'method1',
                  POST: 'method2'
                 ]
    }


Sure, this seems to work:

"/rest/$controller/$id?"(parseRequest:true) {
        action = [GET: "show", POST: "update", PUT:"save", DELETE:"delete"]
        constraints { id(matches:/[0-9]+/) }
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号