Annotation « Resource « JSP-Servlet Q&A





1. @Resource annotated member not injected - bad code or bug?    stackoverflow.com

I am using an @Resource annotation in a class instantiated in a ServletContextListener's contextInitialized(...) method, but the member is always null. Here's my sample code. Listener:

public void contextInitialized(ServletContextEvent sce) {
  System.err.println("In ...

2. Class/Type level resource annotation    coderanch.com