Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When a request is sent to the servlet

 
p hasini
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a servlet class which extends HttpServlet and has service() method and doGet() and doPost() methods defined.Which of the following methods get called when a request is sent for the servlet.

1. Only doGet()
2.Only doPost()
3.only service()
4.doGet() and then service()
5.service() and then doGet()
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"p hl", please check your private messages for an important administrative matter.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like a homework question to me... what's your answer and why?
 
p hasini
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually this is an interview question asked.I dont know the correct reply.

I need the answer
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
p hasini wrote:I need the answer

What're your thoughts on it? JavaRanch is not an answer mill, it's a learning site.

Tell us what you think the answer is, and why, and then we can discuss it.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reading the servlet API before interviewing for a servlet job is highly recommended.
Why not start here!

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic