Easy way to access stateless session beans in EL?

随声附和 提交于 2019-12-12 18:24:24

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/12988089/easy-way-to-access-stateless-session-beans-in-el

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!