...
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 | ||||
---|---|---|---|---|
| ||||
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 | ||||
---|---|---|---|---|
| ||||
<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 | ||||
---|---|---|---|---|
| ||||
<init-param> <param-name>Extension.Packages</param-name> <param-value>com.samaxes.stripes.inject</param-value> </init-param> |
...