my dog learned polymorphism*
The moose likes Servlets and the fly likes Overridding service  Method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Overridding service  Method" Watch "Overridding service  Method" New topic
Author

Overridding service Method

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi Ranchers,

My upcoming project is in jsp/servlet which follows MVC (maintenance project). In that project developer ask to extends BaseServlet which override servlet's service method . code is given below




Here they Override service method. but overridding the service method is not good practise right ?. suppose if i call GET or POST method from form then only this service method is encounter.

so rancher, please give some light on this .


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

What is their reasoning for overriding service()? There are instances where it might be appropriate, but it looks as if this is intended to use as a base class for all servlets.

And this is an atrocity:

Do they not realize that this means that no exceptions can propagate out to the container to be handled in a standard fashion using deployment descriptor error handlers?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Bear Bibeault wrote:There are instances where it might be appropriate, but it looks as if this is intended to use as a base class for all servlets.

yes. but if you are their place then what would be your approach ? (if you dont mind,can you please elaborrate )
Bear Bibeault wrote:
And this is an atrocity:

Do they not realize that this means that no exceptions can propagate out to the container to be handled in a standard fashion using deployment descriptor error handlers?


yes. I agree , you are correct .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Overridding service Method