`
smhx
  • 浏览: 77233 次
  • 性别: Icon_minigender_1
  • 来自: 昆明
社区版块
存档分类
最新评论

seam 组件的默认作用域

阅读更多
无状态Session Bean : 总是属于无状态上下文中。
有状态Session Bean : Conversation Context。它们绝不会绑定到page
                     或stateless context


Entity Bean        : Conversation Context
JavaBeans           : Event Context

消息驱动Bean         : 不能被绑定到Seam上下文
分享到:
评论
4 楼 smhx 2008-06-17  

hantsy 19 小时前
Entity Bean默认绑定到了Conversation Context ?

我查过官方手册了,Entity Bean确实是默认绑定到了Conversation Context。
下面的原文:
4.2.3. Entity beans
Entity beans may be bound to a context variable and function as a seam component. Because entities have a persistent identity in addition to their contextual identity, entity instances are usually bound explicitly in Java code, rather than being instantiated implicitly by Seam.

Entity bean components do not support bijection or context demarcation. Nor does invocation of an entity bean trigger validation.

Entity beans are not usually used as JSF action listeners, but do often function as backing beans that provide properties to JSF components for display or form submission. In particular, it is common to use an entity as a backing bean, together with a stateless session bean action listener to implement create/update/delete type functionality.

By default, entity beans are bound to the conversation context. They may never be bound to the stateless context.


Note that it in a clustered environment is somewhat less efficient to bind an entity bean directly to a conversation or session scoped Seam context variable than it would be to hold a reference to the entity bean in a stateful session bean. For this reason, not all Seam applications define entity beans to be Seam components.

Seam entity bean components may be instantiated using Component.getInstance(), @In(create=true) or directly using the new operator.
3 楼 smhx 2008-06-17  
无语...
请不要把EJB的组件和Seam的JSF组件混为一谈,EJB是个规范,不是由SEAM来决定它的生命周期的


seam 属于扩展ejb应用,将ejb内容无缝的粘合到整个应用框架。
seam的思想将来会成为标准的j2ee web beans实现
2 楼 snakeskin 2008-06-17  
无语...
请不要把EJB的组件和Seam的JSF组件混为一谈,EJB是个规范,不是由SEAM来决定它的生命周期的
1 楼 hantsy 2008-06-16  
Entity Bean默认绑定到了Conversation Context ?

相关推荐

    jboss-seam 注解

    `@Scope`注解用于定义组件的作用域,默认情况下,组件的作用域是由`ScopeType`枚举类型中的某个值来确定的。常见的作用域包括但不限于: - **EVENT**:每次请求时创建新的实例。 - **PAGE**:页面加载时创建并保留...

    jboss seam 注解

    若未显式定义作用域,则遵循默认规则。 - **`@Roles`**: 可以同时指定多个`@Role`,例如: ``` @Roles({ @Role(name="user", scope=ScopeType.CONVERSATION), @Role(name="currentUser", scope=ScopeType....

    JSF常见注解

    - `scope`:上下文变量的作用域,默认与组件的默认作用域相同。 - **示例**: ```java @Role(name="user", scope=ScopeType.SESSION) public class UserComponent { // 组件代码 } ``` #### @Roles - **作用...

Global site tag (gtag.js) - Google Analytics