This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
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: 63548

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
I agree. Here's the link:
subject: please give clear explanation
jQuery in Action, 3rd edition