This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes can i override the service()? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "can i override the service()?" Watch "can i override the service()?" New topic

can i override the service()?

ajay verma
Ranch Hand

Joined: Dec 10, 2007
Posts: 37
what is the use of overriding service() in servlet?
what all methods you can override in place of service() method?
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

You can override it but you shouldn't do so unless you have a real good reason.

As for your second question, see my reply to you other post:
It applies here as well.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41599
Overriding the service method is discussed in more detail in the

Ping & DNS - my free Android networking tools app
subject: can i override the service()?