何时使用doGet,doPost和服务 [英] When to use doGet, doPost and service

查看:121
本文介绍了何时使用doGet,doPost和服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道这些servlet方法。我对这些方法有所了解,比如

I was wondering about these servlet methods. i know something about these methods like


  • doPost 对参数数字没有限制 doGet has。

  • doGet 快于 doPost

  • doPost doGet 。

  • doPost has no limitations on paramater numbers while doGet has.
  • doGet is faster than doPost.
  • doPost is secured than doGet.

我的问题是,因为这些方法采用相同的参数并执行我们实施的流程。那么这些方法和之间的主要区别是什么?这个方法的具体情况用于处理

And my question is, as these methods takes same parameters and does the process which we implement. then what is the major difference between these methods and At which specific situation each of this method is used to process.

推荐答案

你提到的技术差异很大,我们谈论的是REST metaphers。

There's the technically differences you mentioned and there's part where we're talking about REST metaphers.

除了POST和GET之外,还有PUT和DELETE。您应该将GET用于不改变数据的操作,POST用于创建,PUT用于更新数据。 DELETE显然是删除数据。

Beside POST and GET, there's PUT and DELETE too. You should use GET for operations which don't alter your data, POST for creation and PUT for update of data. DELETE is obviously for deletion of data.

这篇关于何时使用doGet,doPost和服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆