This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Niko's servlet mock exam question 45

 
Ranch Foreman
Posts: 1922
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: 25669
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: 1922
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.
 
Evil is afoot. But this tiny ad is just an ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic