[Logo] Mentawai Recipes
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Moderation Log] Moderation Log   [Register] Register / 
[Login] Login 
Auto-wiring your components  XML
Forum Index » Official Recipes
Author Message
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").
 
Forum Index » Official Recipes
Go to:   
Powered by JForum 2.1.8 © JForum Team