Struts2-rest-plugin的用法

来源:互联网 发布:数据挖掘工程师的一天 编辑:程序博客网 时间:2024/06/05 20:57

Struts2-rest-plugin:提供基本的Rest请求映射和结果返回的功能,如:

GET:    /movies                => method="index"

GET:    /movies/Thrillers      => method="show",id="Thrillers"

GET:    /movies/Thrillers;edit =>method="edit", id="Thrillers"

GET:    /movies/Thrillers/edit =>method="edit", id="Thrillers"

GET:    /movies/new            => method="editNew"

POST:   /movies                => method="create"

PUT:    /movies/Thrillers    => method="update",id="Thrillers"

DELETE: /movies/Thrillers   => method="destroy",id="Thrillers"

默认的为GET方法, 要想用POST方法,用法是url?_method=POST,其他同


原创粉丝点击