• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Qsn from JwebPlus

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which HTTP method and corresponding HttpServlet method should be used when a user clicks on the Submit button of a FORM used for capturing the username/password of the user?
a. FORM & doForm()
b. GET & doGet()
c. POST & doPost()
d. PUT & doPUT()
The ans given is c.
But the default method for FORM is GET and hence option b should be correct choice if nothing is mentioned about the method used in the FORM.
Pls clarify.
Thanks.
 
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These are the *key* parts of the question:
Which HTTP method and corresponding HttpServlet method should be used when a user clicks on the Submit button of a FORM used for capturing the username/password of the user?
should be used - meaning -- how should you design this form so that its designed in the best way?
used for capturing the username/password - this is the key part of the question -- you don't want a username/password to be included in the URL in plain view -- so you'll want to "hide it" in a POST request.
[ April 07, 2003: Message edited by: Jessica Sant ]
 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Boy, that question had me fooled too. Until I read Jessica's response. I guess you have to remember to use your common sense when answering these questions, just as you would in real development, and not just what you've gotten from books. Obviously common sense, once it's reawoken, says that you don't want to put the login and password in a query string for all to see.
 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well Jessica seems to be a real guru in SCWCD stuff.
Salutations !
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Sumit Amar:
Well Jessica seems to be a real guru in SCWCD stuff.


As much as I like the compliment -- please doubt everything you ever read that I (or anyone else) types. I've been wrong before and guarantee I'll be wrong again.
So.. read the answer someone gives you -- and then try it out for yourself -- write up a lil web app -- throw in the code, see what happens -- check the spec, search through the archives... Does the answer make sense??
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic