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

Niko's servlet mock exam question 45

 
Ranch Foreman
Posts: 1907
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From Niko's servlet mock exam at
https://nikojava.wordpress.com/2009/03/12/free-scwcd-mock-exam-for-servlets/,
question 45


What is the output when the form is submitted? (1 correct answer)

a. GET
b. POST
c. A HTTP 405 message informs that GET is not supported.
d. A HTTP 405 message informs that POST is not supported.

The given answer is d


But when I code it, the answer is b. It prints out POST.


Niko's mock exams can be found at https://coderanch.com/t/659877/Wiki/Scwcd-Mock-Tests
 
Marshal
Posts: 25601
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you copy and paste that code, so that the parameters of doPost() are in a different order from the parameters of doGet()? Or did you retype it in such a way that both methods have their parameters in the same order?
 
Himai Minh
Ranch Foreman
Posts: 1907
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Paul. Thanks.
My post method was



It works.

When I swap the order of HttpServletRequest and HttpServletResponse, it returns POST method not supported error.
 
Police line, do not cross. Well, this tiny ad can go through:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic