• 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
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Javaranch.com Question Bank ID : 51 Section 1 - The Servlet Model

 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Javaranch.com Question Bank ID : 51 Section 1 - The Servlet Model



What is the result of compiling the above Servlet and accessing it by typing:
"http://www.javaranch.com/test/HelloServlet"
into the address field of a browser

If we see here, the only thing we have is a servlet class and the URL.
The question never says that there is a appropriate [assume] <servlet> entries in the DD. Hence i assumed that since the DD is not given , the given URL will never invoke the above servlet and simply respond saying that page cannot be found. To my surprise the answer the question was

An error page is returned from the Server. With explaination as
The Servlet does not implement a doGet method so, an error is returned.

and my answer "The server will not find the Servlet due to an incorrect URL." was rejected.

Who is correct? Can we expect such type of questions in exam
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the question lacks of an assumption about mapping to the servlet. Since there is no such an assumption, we'd better to think it has a correct mapping.
So my answer is "An error page is returned from the Server..."
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both answers could be deemed correct. I wouldn't worry about it, it's not representative of the actual exam!

In my experience the SCWCD questions were well written and unambiguous. They gave you all the information you needed to correctly answer the question.

If faced with an ambiguous question, I take it from the point of view of "what knowledge is this exam question expecting me to demonstrate".

In this scenario it is more likely to be wanting you to demonstrate that you know a typed browser URL request requires a matching doGet() method than a servlet needs a URL mapping in the DD. If they wanted you to demonstrate the latter they'd have at least mentioned the DD in my opinion.

Rufus.
 
We begin by testing your absorbancy by exposing you to this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic