• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

access servlet from url

 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I met a question saying a servlet A_servlet has implmented doGet(), doPost() and is mapped to an URL http://blah/A_servlet, when a user accesses it, which method will be executed?
A. doGet(), B. doPost(), C. Cannot be determined based on the given info

I chose C while its answer is A. I know the default method for accessing from the URL is doGet(), but there is no info given where that servlet locates, whether its for internal or external usage. There is no info about its security setting. So I think the correct answer should be C. Am I right?
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since that the question mentioned about the servlet is mapped to http://blah/A_servlet, and a user access it, then it should be possible that the answer is A (doGet). My gut feeling is that the question is expecting you to understand that Post is more appropriate for program to access the servlet (such as HTML form), rather than user.

Just my 2cents.
 
reply
    Bookmark Topic Watch Topic
  • New Topic