Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Methods to handle form data

 
Tyronne Fernando
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the question is "Which methods are used by a servlet to handle form data from a client?", is HttpServlet.doPost() is the only correct answer?

Is HttpServlet.doGet() a correct answer as well? Any other methods we can add as a correct answer?

This is question 8 on page 146 of HFSJ 2nd edition.

Thanks in advance.
 
Charles Lyons
Author
Ranch Hand
Posts: 836
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The (X)HTML specifications allow both POST and GET as submission methods for forms. Usually it's the former though because of the amount of data to be transferred, and the limitations on the length of a URL (using GET). Often the form will POST, and then the client will be HTTP-redirected using GET to avoid problems with the back button and form re-submission.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic