Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Grokking Bitcoin 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
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Cafe4Java Mock question  RSS feed

 
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 611
1
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And why do you think it isn't?

Hint: isn't the typing an URL into the browser somewhat similar to clicking a hyperlink?
 
Nidhi Sar
Ranch Hand
Posts: 252
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pedro, yes it should be invoke GET method. Thanks.
 
Seriously? That's what you're going with? I prefer this tiny ad:
ScroogeXHTML - the small and fast RTF to HTML converter library
https://coderanch.com/t/707504/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!