This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Calling a method from the servlet." Watch "Calling a method from the servlet." New topic
Author

Calling a method from the servlet.

John Paterson
Ranch Hand

Joined: Mar 12, 2012
Posts: 121

Hi,

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.

regards
John
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
OCJA(5/6) OCJP(6) OCJWCD(6)
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

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


SCJP, SCWCD.
|Asking Good Questions|
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Calling a method from the servlet.