DI « EJB « JSP-Servlet Q&A





1. Can Servlet use DI to access EJB    coderanch.com

3. EJB DI    coderanch.com

4. Help with EJB DI    coderanch.com

5. Where to use @EJB DI?    coderanch.com

************************Calculator.java***************************** @WebService(name="CalculatorPortType", targetNamespace = "http://test.com") public interface Calculator { @WebMethod public int add(@WebParam(name = "value1") int value1, @WebParam(name = "value2") int value2); @WebMethod public String getVersion(); } ****************************CalculatorService.java******************** @WebService(serviceName = "Calculator", portName="CalculatorPort", endpointInterface = "com.test.Calculator", targetNamespace = "http://test.com" ) public class CalculatorService implements Calculator { @Resource private WebServiceContext context; @EJB(mappedName="EventProcessor") private EventProcessor eventProcessor; public int add(int value1, int value2) { System.out.println("User ...