aspose file tools*
The moose likes Servlets and the fly likes When a request is sent to the servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "When a request is sent to the servlet" Watch "When a request is sent to the servlet" New topic
Author

When a request is sent to the servlet

p hasini
Ranch Hand

Joined: Oct 24, 2009
Posts: 92
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

Joined: Jan 10, 2002
Posts: 61756
    
  67

"p hl", please check your private messages for an important administrative matter.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

Looks like a homework question to me... what's your answer and why?
p hasini
Ranch Hand

Joined: Oct 24, 2009
Posts: 92
Actually this is an interview question asked.I dont know the correct reply.

I need the answer
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

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

Joined: Mar 22, 2000
Posts: 12835
    
    5
Reading the servlet API before interviewing for a servlet job is highly recommended.
Why not start here!

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When a request is sent to the servlet