can we override service method in my servlet class..?? if
yes or no why ??

Answer Posted / ruchi

we can override service method in my servlet class if the
request is not protocol dependent.
Bcoz we exdend HttpSrevlet class to handle Http GET and
POST requests and we have to override some methods like
doGet,doPost,doHead,doPut,doDelete.

But if u want to override service method then u have to
extend genricServlet Class.Then only u can implement Service
() method.

Is This Answer Correct ?    52 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List the Different types of servlet?

571


What are the ways to handle multi-threading in servlets?

585


What are the annotations used in servlet 3?

568


What are the different types of servlets?

508


How can we perform any action at the time of deploying the project?

615






What are the advantages of servlets over traditional cgi?

618


What are the uses of servlet and what is servlet chaining?

554


If servlet receives multiple requests, how many objects will it create?

819


What is the advantage of Servlets when compared with other server side technologies?

1849


What is http servlet in java?

554


Why is it that we can't give relative URL's when using ServletContext.getRequestDispatcher() when we can use the same while calling ServletRequest.getRequestDispatcher()?

610


What is servlet container?

659


The code in a finally clause will never fail to execute, right?

593


How to upload a file to the server using servlet?

526


Which java framework is most popular?

572