Meaningless Drivel is fun!
The moose likes Servlets and the fly likes Calling a method from the servlet. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Calling a method from the servlet." Watch "Calling a method from the servlet." New topic

Calling a method from the servlet.

John Paterson
Ranch Hand

Joined: Mar 12, 2012
Posts: 170


I have a servlet in which I create a method 'A' which basically instantiates a class and than invokes method 'B' from this class. I invoke this method A from the init method
of the servlet. I have a print statement both in method A, and method B. When I run the servlet I am getting the print result from method A in the console, but I don't get
anything from method B, which I believe implies method B is not being reached. The code looks fine to me. How do I trouble shoot this? I am using Eclipse Indigo. Hope someone
can advise. Thank you.

Saif Asif
Ranch Hand

Joined: Aug 11, 2011
Posts: 440

Hello peter.

I think we will have a better understanding if you paste the code snippet here.

Muhammad Saif Asif Mirza
Amit Ghorpade

Joined: Jun 06, 2007
Posts: 2851

Unless you are trying this out of curiosity, it looks like a not so good design to me.

|Asking Good Questions|
I agree. Here's the link:
subject: Calling a method from the servlet.
It's not a secret anymore!