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

Form Fields - Get Method

 
Ashok Kumar Babu
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

This question I found in Marcus Green Summary Quiz 3 and Question No:17.

Question:
17.Which servlet methods are used by servlets to process the data in form fields?
Choose at least one answer. a. init
b. servlet
c. doForm
d. doGet
e. doFields
f. doPost

Answer says only f.

Now My doubt is "Cant the doGet method access the Form Fields?"

Thanks

Ashok
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Forms can submit either as GET or POST. In fact, GET is the default.

So doGet should also be a correct answer.
 
Ashok Kumar Babu
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marc.
 
Tina Ma
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NO....form data is handled by doPost() only in a servlet.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sreerupa, can you elaborate to support your position? What part of my explanation do you disagree with?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
form data is handled by doPost() only in a servlet

Have a closer look at the METHOD attribute of the html FORM tag, and think of what will happen when its value is set to GET.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic