saoj
Joined: 10/01/2008 08:20:15
Messages: 39
Offline
|
The classic example is a DAO that depends on a java.sql.Connection. All you have to do in your ApplicationManager is:
Now everything that has an attribute of type Connection.class with the name "conn" will receive a connection. The connection will come from the action input with the same name (key) "conn".
The injection will happen through a setter (setConn) or straight into the private or public instance variable (Connection conn).
You can also use the source method to define a different key value that will be used to get the connection implementation from the action input.
Instead of doing a input.getValue("conn") to get the connection, the DIFilter will do a input.getValue("connection").
|