Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Code

Injection through field

<b>maxLineItem</b> maxLineItem field in <b>PurchaseOrderBean<b> PurchaseOrderBean class is annotated with @Resource annotation to inject a simple environment entry. Default value of10 is assigned. Deployer can modify the values of the environment entries at deploy time in deployment descriptor.

Injection through a setter method

<b>setMaxLineItem</b> setMaxLineItem method in <b>Invioce<b> InvioceBean class is annotated with @Resource annotation to inject a simple environment entry. By default, the JavaBeans propery name is combined with the name of the class in which the annotation is used and is used directly as the name in the bean's naming context. JNDI name for this entry would be:

...