When doPut () is called in a servlet?

Hi, I was just curious when the doPut () method in the called servlet. I know that if the form on the jsp / html page has a method of "post", then doPost () is called differently, if it has a "GET", then doGet () is called. When is doPut () called?

+3
source share
3 answers

The doPut () method handles send requests using the HTTP PUT method. The PUT method allows the client to store information on the server. For example, you can use it to publish an image file to a server. As stated above, in most cases goGet () and doPost () are used. In my case, I use only these two, and I only receive requests, so I just pass the request to get doPost () and easily do my job.

+3
source

If an HTTP PUT request is received, naturally.

Can a page execute a PUT request by code?

The only valid attribute values methodfor <form>are getand post, in accordance with the HTML5 specification . I assume that you are asking.

+7

if you want to send some confidential values ​​to url via the form, you should use the post method. If you use the get method for a form such as login, parameter values ​​such as userid and password will be visible in the URL, and anyone can crack this item. Therefore, it is better to use the post method in forms. By default, it is called by the get method.

in get the url is like http://url?method=methodname&userid=123&password=123

so if you use post method the url will be like this http://url/methodname.do
-2
source

All Articles