title: Is dependency injection possible for JSP beans?
body: <p>This may be a long shot question..</p>
  
  <p>I am working on an application that is based on JSP/Javascript only (without a Web framework!)</p>
  
  <p>Is there a way to have depencency injection for JSP beans?
  By jsp beans I mean beans defined like this</p>
  
  <pre><code>&lt;jsp:useBean id="cart" scope="session" class="session.Carts" /&gt;
  </code></pre>
  
  <p>Is there a way/library/hack to intercept the bean creation so that when "cart" is referenced for the first time, some some of injection takes place?</p>
  
  <p>Can I define somewhere a "listener" for JSP beans (like you can do for JSF beans for example)?</p>
  
  <p>I am free to do anything I want in the back-end, but I cannot add a web framework in the front-end (Don't ask!)</p>