how can we call the generic servlet from a http request, can we use the service inside the http servlet are there any restrictions to use service method in http servlet
There are no restrictions. But service(...) method of the GenericServlet provides a fair bit of housekeeping that you'd just have to do yourself. If you have some share functionality, you can use composition to achieve reuse by creating a helper class & methods and call that at the beginning of e.g., doPost() and doGet(). If you prefer using inheritance to achieve code reuse then you can do something like following in your extending class: