Is dependency injection possible for JSP beans?

Posted by kazanaki on Stack Overflow See other posts from Stack Overflow or by kazanaki
Published on 2010-04-30T10:02:12Z Indexed on 2010/04/30 10:07 UTC
Read the original article Hit count: 314

Filed under:
|
|
|

This may be a long shot question..

I am working on an application that is based on JSP/Javascript only (without a Web framework!)

Is there a way to have depencency injection for JSP beans? By jsp beans I mean beans defined like this

<jsp:useBean id="cart" scope="session" class="session.Carts" />

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?

Can I define somewhere a "listener" for JSP beans (like you can do for JSF beans for example)?

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!)

© Stack Overflow or respective owner

Related posts about java

Related posts about jsp