User Tools

Site Tools


additional_di_values

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

additional_di_values [2014/01/11 10:40]
mihael created
additional_di_values [2014/01/11 11:20] (current)
mihael
Line 19: Line 19:
   ​   ​
 Now you can put your values into the context with the ''​set()''​ method. Now you can put your values into the context with the ''​set()''​ method.
 +
 +===== Inject by Class =====
 +Default is to lookup the injected object by its class if your are plainly using ''​@Inject''​.
 +
 +===== Inject by Name =====
 +If you have to inject multiple objects with the same class or want to be sure that you get a specific object injected you can use the ''​@Named''​ annotation. You add the value to the context with ''​context.set(name,​ object)''​.
 +
 +  @Inject @Named("​inputUri"​) private String inputUri;
 +
  
 {{tag>e4 devel java}} {{tag>e4 devel java}}
additional_di_values.txt ยท Last modified: 2014/01/11 11:20 by mihael