File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 60048
    
  65

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 .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Overridding service Method
 
Similar Threads
My very own MVC framework...
Confused about Life cycle of Servlets
multiple get requests - one thread serving them all?
dopost() and doget() methods
Problem with request.getParameter