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

Answer Posted / muzaffar

Yes, we can override service method. But then we have to give our own implementation to detect which type of method request is using.(i.e GET or POST). Since we mostly use HTTP as a protocol itz best to extend HTTPServlet and override doGET or doPOST accordingly.

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How httpservlet is different from the genericservlet?

558


Explain in brief the directory structure of a web application?

564


How do you create a cookie using servlet?

575


What is meant by Servlet? What are the parameters of service method?

589


What is the use of servlet context?

525






What is the effective way to make sure all the servlets are accessible only when user has a valid session?

561


What is the life cycle of a servlet?

776


What is the difference between forward () and sendredirect () functions in servlet? Explain

540


Difference between java beans & servlets?

583


How is a servlet implemented in code?

560


Why are http servlets used in programming?

541


A client sends requests to two different web components. Both of the components access the session. Will they end up using the same session object or different session ?

601


What is servlet and its advantages?

519


What exactly is a servlet?

537


What is the use of request dispatcher interface?

563