8 Replies Latest reply on May 18, 2009 12:47 AM by Mike Wilson

    simplest possible servlet app

    Mike Wilson Newbie

      I'm trying to put together a really small example using WebBeans RI in a basic servlet app. WebBeans kicks in but doesn't instantiate MyService for me (null in doGet). Here's the code:



      public class MyServlet extends HttpServlet {
           @Current MyService service;
           protected void doGet(...) ... {
                response.getWriter().print(service.getStuff());
           }
      }
      
      @ApplicationScoped
      public class MyService {
           ...
      }
      
      WEB-INF/web.xml:
           <servlet>
           ...
           <servlet-mapping>
           ...
           <listener>
                <listener-class>
                     org.jboss.webbeans.environment.servlet.Listener
                </listener-class>
           </listener>
      
      WEB-INF/lib:
           webbeans-servlet.jar
      



      Obviously, I'm missing something...?