为什么WebBeans(JSR-299)会话上下文与JSF绑定?

时间:2021-05-27 19:59:23

I am reading through the Public Review Draft of the Web Beans specification (JSR-299) and I am wondering why it is so 'tightly coupled' to JSF?

我正在阅读Web Beans规范的公共评论草案(JSR-299),我想知道为什么它与JSF“紧密耦合”?

Especially the Conversation Context seems only be specified for JSF.

特别是Conversation Context似乎只为JSF指定。

I understand, that it is a goal of WebBeans to integrate JSF and EJB3. But would it not make sense to specify the concept of conversations on a more general level (maybe for Servlets in general and not for a specific web framework)?

我理解,WebBeans的目标是集成JSF和EJB3。但是,在更一般的层面上指定对话的概念是否有意义(对于一般的Servlet而不是特定的Web框架)?

Is there any technical reason for this? I think it can hardly be, because Seam (which is some Kind of WebBeans-Prototype) does also support Wicket and provides the concept of conversations.

这有什么技术原因吗?我认为这很难,因为Seam(某种WebBeans-Prototype)也支持Wicket并提供对话的概念。

I think it would be helpful to have a Conversation Scope on Servlet level (injecting of conversation-scoped beans into servlets). In my understanding, this is not the case with the ciurrent specification (see chapter 8.5.4). Or am I misinterpreting something here ...

我认为在Servlet级别上有一个Conversation Scope会很有用(将会话范围的bean注入servlet)。根据我的理解,ciurrent规范不是这种情况(见第8.5.4章)。或者我在这里误解了一些东西......

2 个解决方案

#1


1  

Just found this today. The reason why the ConversationScope is JSF based is simply because JSF is the standard UI framework for Java EE!

刚今发现了这个。 ConversationScope基于JSF的原因仅仅是因为JSF是Java EE的标准UI框架!

Beside this, most of the JSR-299 containers can provide Conversations for other UI technologies like e.g. Wicket too.

除此之外,大多数JSR-299容器都可以为其他UI技术提供对话,例如: Wicket也是。

Otoh you can easily create your own Scopes which are even portable.

Otoh您可以轻松创建自己的Scopes,甚至可以移植。

LieGrue, strub

#2


1  

I think it's soley down to Gavin King picking JSF as his view technology for Seam and him pushing through the JSR as spec lead.

我认为Gavin King采用JSF作为他对Seam的观察技术以及他作为规范领导者推动JSR,这已经太过分了。

Clearly conversations go wider - for instance, Spring custom scopes have a facility for providing conversations:

显然,对话变得更广泛 - 例如,Spring自定义范围有提供对话的工具:

http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/config/Scope.html

#1


1  

Just found this today. The reason why the ConversationScope is JSF based is simply because JSF is the standard UI framework for Java EE!

刚今发现了这个。 ConversationScope基于JSF的原因仅仅是因为JSF是Java EE的标准UI框架!

Beside this, most of the JSR-299 containers can provide Conversations for other UI technologies like e.g. Wicket too.

除此之外,大多数JSR-299容器都可以为其他UI技术提供对话,例如: Wicket也是。

Otoh you can easily create your own Scopes which are even portable.

Otoh您可以轻松创建自己的Scopes,甚至可以移植。

LieGrue, strub

#2


1  

I think it's soley down to Gavin King picking JSF as his view technology for Seam and him pushing through the JSR as spec lead.

我认为Gavin King采用JSF作为他对Seam的观察技术以及他作为规范领导者推动JSR,这已经太过分了。

Clearly conversations go wider - for instance, Spring custom scopes have a facility for providing conversations:

显然,对话变得更广泛 - 例如,Spring自定义范围有提供对话的工具:

http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/beans/factory/config/Scope.html