wood burning stoves
The moose likes Servlets and the fly likes please give clear explanation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "please give clear explanation" Watch "please give clear explanation" New topic

please give clear explanation

anilkumar choudary

Joined: Jun 15, 2006
Posts: 6
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
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

Please take the time to choose better subject lines for your posts. Read this for more information.

[Asking smart questions] [About Bear] [Books by Bear]
ak pillai
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
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:

[ July 14, 2006: Message edited by: ak pillai ]

java j2ee job interview questions with answers | Learn the core concepts and the key areas
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: please give clear explanation
It's not a secret anymore!