Back to Top

Sunday, 8 July 2012

J2EE: SERVLET: doGet() vs. doPost()

doGet():

  • protected void doGet(HttpServletRequest req, HttpServletResponse resp)throws ServletException, java.io.IOException – is a method of Class HttpServlet. It is called by the server (via the service method) to allow a servlet to handle a client's GET request.
  • In doGet(), the client’s request parameters are appended to the URL and sent along with header information.
  • doGet() is not a secured process because the request parameters are clearly visible in the URL.
  • Since request parameters are sent along with header information, so only a limited amount of data should be sent.



doPost():
  • Protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException – is a method of Class HttpServlet. It is called by the server (via the service method) to allow a servlet to handle a POST request.
  • In doPost(), the client’s request parameters are submitted via form.
  • As in doPost(), client’s request parameters are sent via form body, the parameters’ values are not visible in any where, so its safe and secure.
  • This method allows the client to send data of unlimited length to the Web server a single.
Anijit Sarkar

11 Responses to “ J2EE: SERVLET: doGet() vs. doPost() ”

Asif said...
7 September 2012 at 21:32

hello ! have u any interest in data structure ???


Asif said...
7 September 2012 at 21:34

hello ! have u any interest in data structure ???


shovan das said...
29 April 2013 at 15:19

thanks


Naviya Nair said...
24 October 2016 at 15:11

I have read your blog its very attractive and impressive. I like it your blog.

Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

Online Java Training Java 8 Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai Java Training Institutes

Java Training Institutes in Chennai Java Training in Chennai


Naviya Nair said...
24 October 2016 at 15:26

I have read your blog its very attractive and impressive. I like it your blog.

Java Training in Chennai Java Training in Chennai | Core Java Training in Chennai

Online Java Training Java 8 Online Training | Java J2EE Online Training | JavaEE Training Institute in Chennai Java Training Institutes

Java Training Institutes in Chennai Java Training in Chennai


Karthika Shree said...
18 May 2017 at 10:31

It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.
Java Training in Chennai


Ancy merina said...
2 March 2018 at 11:27

This information really worth saying, i think you are master of the content and thank you so much sharing that valuable information and get new skills after refer that post.
Web development company in bangalore| web design company bangalore


anurag singh said...
17 March 2018 at 12:35

Nice article about Java Servlet doGet() and doPost.

Servlet Interview Questions and Answers. .

thanks for this


calfre services said...
28 July 2018 at 17:22

hi your blog Article is very nice & thanks for sharing the information.java training


Dipanwita said...
10 August 2018 at 12:57

Very interesting blog. java training in chennai


sumant kumar said...
29 August 2018 at 18:10

best blog.thank you for sharing useful info.
visit
web programming tutorial
welookups


Post a Comment

Popular Posts

All Rights Reserved JAVA INTERVIEW QUESTIONS | Privacy Policy | Anijit Sarkar
blog links Web Directory Academics Blogs