</session>
</enterprise-beans>
We have specified the <ejb-class> so why do we need to have a <injection-target-class> ?
Mihai Radulescu
Ranch Hand
Joined: Sep 18, 2003
Posts: 912
posted
0
Hi Sasinda
The ejb-class represents the bean corresponding class for the a given environment and the injection-* represents the injection applying point.
More precisely, the ejb-class is used to declare entries in the bean context, all the bean instances from this type may use this entries (via JNDI calls) - please notice the "may use it"; there is no must this is just a declaration.
The injection-target-class is used to specify the injection application point - it means inject this instance in this field.
Even if both elements (ejb-class and injection-target-class) have the same meaning they are used in different contexts.
If you dislike to see the "class" in two places you can remove the <ejb-class> element and use <remote> or <local> with the implemented interface.