• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Overridding service Method

 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 .


 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 .
reply
    Bookmark Topic Watch Topic
  • New Topic