Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Methods to handle form data

 
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.
 
Author
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.
 
Don't listen to Steve. Just read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic