Versions Compared

Key

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

...

However you can manually set the JNDI name to lookup using the mappedName attribute for @EJB, as well as the mappedName and name attributes for @Resource:

Code Block
java
java
 
public class MyActionBean implements ActionBean { 

    @Inject 
    private FooService fooService; 

    @EJB(mappedName = "java:global/stripes-enricher/business/BarServiceBean") 
    private BarService barService; 

    @Resource(mappedName = "java:comp/env/greeting") 
    private String greeting; 
    // same as 
    @Resource(name = "greeting") 
    private String greeting; 

} 

...

Add Stripes Injection Enricher dependency to your project:

Code Block
xml
xml
<dependency> 
  <dependency>  <groupId>com.samaxes.stripes</groupId> 
    <artifactId>stripes-injection-enricher</artifactId> 
    <version>VERSION</version> 
</dependency> 

...

Add Stripes Injection Enricher to Stripes Extension.Packages property:

Code Block
xml
xml
 
<init-param> 
    <param-name>Extension.Packages</param-name> 
    <param-value>com.samaxes.stripes.inject</param-value> 
</init-param> 

...