Sunday, September 25, 2011

Java Interview Questions - 84

Should I override the service() method?

No. It provides a fair bit of housekeeping that you'd just have to do yourself. If you need to do something regardless of whether the request is e.g., a POST or a GET, create a helper method and call that at the beginning of e.g., doPost() and doGet().

No comments: