wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Cafe4Java Mock question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Cafe4Java Mock question" Watch "Cafe4Java Mock question" New topic
Author

Cafe4Java Mock question

Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

This question is from Cafe4Java mock SCWCD exam :

Q4) Which of the following events/ code will invoke the GET (doGet) method of a servlet?

A)
<form action="/servlet/Cafe4Java" method="GET">
..
..
</form>

B)
<form action="/servlet/Cafe4Java">
..
..
</form>

C)
<a href="www.Cafe4Java.com/servlet/Cafe4Java">Cafe4Java

D)
<form action="/servlet/Cafe4Java" method="doGet">
..
..
</form>


The correct answers given are: A, B, C

I'm doubtful about the choice C. Is hyperlink-clicking the way to access doGet() method of a servlet?

Thanks,
Nidhi

"A problem well stated is a problem half solved.” - Charles F. Kettering
SCJP 6, OCPJWCD
Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

And why do you think it isn't?

Hint: isn't the typing an URL into the browser somewhat similar to clicking a hyperlink?


OCP Java SE 6 Programmer, OCM Java SE 6 Developer, OCE Java EE 6 JSPSD, OCE Java EE 6 EJBD, OCE Java EE 6 JPAD, Spring 3.0 Core Professional.
Nidhi Sar
Ranch Hand

Joined: Oct 19, 2009
Posts: 252

Hi Pedro, yes it should be invoke GET method. Thanks.
 
jQuery in Action, 2nd edition
 
subject: Cafe4Java Mock question