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

Answer Posted / rajesh

We can override Service method in the servlet when we extend GenericServlet to create servlet as it is mandatory to override it. But when we extend HttpServlet to create a servlet then we cant override service as we need to override doGet or doPost method of HttpServlet

Is This Answer Correct ?    17 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is servlet in simple terms?

558


What are the differences between servlet context vs servlet config?

575


How do you create a cookie using servlet?

575


What’s the difference between genericservlet and httpservlet?

523


Explain jsessionid and when is it created?

589






Difference between forward() method and sendredirect() method ?

580


How servlets are deployed in java?

540


What is the difference between servlet and jsp?

592


What is http servlet? Explain with the help of an example.

576


What is cgi and what are its drawbacks?

548


Which exception is thrown if the servlet is not initialized properly?

582


Can filter be used as request or response?

540


What's the use of servletcontext?

671


Write a program to show the functionality of doget and dopost method?

649


What is the difference between context parameter and context attribute?

527