Sebastian Hoffmann
Sebastian Hoffmann

Reputation: 11502

Easy way to access stateless session beans in EL?

Is there any possibility in EL to invoke a method of a stateless session bean without wrapping in a backing bean? Wrapping the method call in a backing bean produces redundant code and makes performing BU cumbersome as one has to wrap every single method.

Upvotes: 2

Views: 384

Answers (1)

BalusC
BalusC

Reputation: 1109635

You can just annotate it with CDI's @Named.

E.g.

@Named
@Stateless
public class FooService {
    // ...
}

The properness of the design is questionable. It's IMHO tight coupling. I'd use this approach at most for extremely small webapps or quick prototyping.

Upvotes: 5

Related Questions