This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Well, I think the question needs to be raised about the design, more than how an EJB can call a method on a Servlet. The big question then is why is that method in the Servlet and not in an seperate helper class that both Servlet and EJB can call? Or even in a Session EJB. The way I always think of Servlets are work done in the service type methods, doPost, doGet, doHead, etc. They respond to a request and send stuff back, if needed. The Servlet, itself might have private methods that the Servlet needs. (Which I still think that these methods should be in a different class) But the Servlet should not have methods that outside classes need to call. My Opinion of course. Mark
Mark hit the nail on the head. I've never done what you want to do but you should be able to instantiate the class just like any other as long as there is a constructor and then just invoke the method.
No more rhymes! I mean it!<br /> <br />Does anybody want a peanut?