阅读背景:

获取具有其他名称的会话范围bean的新实例

来源:互联网 

I have a session scoped bean for a UI to edit some data. It is annotated with @Named and @SessionScoped and all runs in JBoss 6.2. Now I got the requirement for a nearly similar edit UI. The problem is that the two UIs can exist in parallel. So for a perfect reuse it would be nice to create a new instance of the bean with another name. Unfortunately I have no clue how to do this in a clean CDI way. I don't like it so much to inherit from the bean and give another name. This was one of my ideas. Another idea was to implement in the managed bean only the business logic and keep the data encapsulated from them and set the data object inside the managed bean when it is needed in the specific context. But maybe there is another CDI way with producers or something? Changing the scope of the bean to ViewScope makes no sense in my case.I have a session scoped bean for a UI to edit s




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: