restful
共 2 篇文章
struts拓展restful
为restful开发的话,一定要设计到URL,struts正好是管理URL的 所以在struts的项目中用restful, 要遵守struts的规则 rest在struts中对应的方法 上面是官方给出的帮助文档(默认情况下) get,不带id参数——index get,带id——show post,不带id——create put,带id——update delete,带id——destroy get,带id且访问edit资源——edit get,不带id访问edit资源——editNew rest的相关常量 struts.mapper.idParameterName - If set, t…
restful是什么
resful是什么 rest是一种 开发的风格 ,他不是框架,也没有类库,是一种 约定 有什么不同 非restful的开发方式 当没有接触restful的时候,URL通常是动词,比如127.0.0.1:8080/unrestful/getFile restful的开发方式 restful的URL是名词,比如127.0.0.1:8080/restful/file 通过请求消息的method来调用具体的业务 约定的method get,获取数据 post,新增数据 put,更新数据 delete,删除数据 约定大于配置 当约定好get、post、put、delete这几种method对应处理什么…