Is dependency injection possible for JSP beans?

This may be a question with long shots.

I am working on a JSP / Javascript based application only (no web framework!)

Is there a way to have an overlay injection for JSP beans? By jsp beans, I mean beans, defined as

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

Is there any way / library / to crack the bean creation interception so that the first access to the "basket" will cause some kind of injection?

Can I define a “listener” for JSP beans somewhere (for example, you can make beans for JSF)?

I can do whatever I want in the background, but I cannot add a web framework in the interface (don’t ask!)

+3
source share
1

, spring AspectJ - @Configurable <context:load-time-weaver/> ( aop spring docs)

+1

Source: https://habr.com/ru/post/1743482/


All Articles