How to check if get or post method is called
html does not include which method (GET OR POST) should be called after a certain action. how to determine if the servlet has a request to get or post
-
Use F12 to see the console in your internet explorer.
-
See the server log on the application server.
- Open Google Chrome
- Go to your website
- Right click on the web page and click "Inspect Element"
- Click on the Network icon and you will see which methods are being called.
Council. You may need to refresh the page
dispatch action, check url info, if url contains parameters, "get" method; otherwise, the method is a message. eg. when logged in with 'name' and pwd '123123' Get: http: // . .com / actionName? Name = name & pwd = 123123 Message: http: // . .com / actionName
If you do not specify a method attribute in your html form, the servlet container accepts your request as GET.see Here If you do not specify a method attribute, the doGet () method is called. If you put a post in your method, the doPost () method is called.