如何将seam集成到现有项目中。或者相反

时间:2022-04-06 20:00:14

Is there any documentation about introducing jBoss seam to an old Hibernate/JSF project?

有没有关于将jBoss seam引入旧的Hibernate / JSF项目的文档?

Have tried google, and what I found was: Start new seam project, copy&paste existing code into new project. Would be nice to know a little bit more before starting.

尝试了谷歌,我发现的是:启动新的缝纫项目,将现有代码复制并粘贴到新项目中。在开始之前了解一点会很高兴。

2 个解决方案

#1


1  

The best approach is probably to add the Seam library to your existing project, and then gradually refactor your code to take advantage of Seam's features. To do this, work through the Seam manual and refactor your code for each Seam feature that simplifies the JSF approach. This includes things like:

最好的方法可能是将Seam库添加到现有项目中,然后逐步重构代码以利用Seam的功能。为此,请完成Seam手册并为每个简化JSF方法的Seam功能重构代码。这包括以下内容:

  • make your JSF action listener classes into Seam components (i.e. add one annotation)
  • 将您的JSF动作侦听器类设置为Seam组件(即添加一个注释)

  • merge action listener and EJB classes (action listeners can be EJBs in Seam)
  • 合并动作侦听器和EJB类(动作侦听器可以是Seam中的EJB)

  • inject a Seam managed persistence context instead of your existing Hibernate session
  • 注入Seam托管持久化上下文而不是现有的Hibernate会话

  • simplify page navigation rules using Seam navigation syntax
  • 使用Seam导航语法​​简化页面导航规则

  • migrate views to Facelets, if you are still using JSP.
  • 如果您仍在使用JSP,请将视图迁移到Facelets。

Basically, Seam will probably give you lots of ways to simplify your existing code, so apply them one at a time to see how they work.

基本上,Seam可能会为您提供很多简化现有代码的方法,因此请逐一应用它们以查看它们的工作原理。

#2


0  

This seems to be part of the solution:

这似乎是解决方案的一部分:

http://www.mastertheboss.com/en/seam/63-jboss-seam-tutorial-1.html

#1


1  

The best approach is probably to add the Seam library to your existing project, and then gradually refactor your code to take advantage of Seam's features. To do this, work through the Seam manual and refactor your code for each Seam feature that simplifies the JSF approach. This includes things like:

最好的方法可能是将Seam库添加到现有项目中,然后逐步重构代码以利用Seam的功能。为此,请完成Seam手册并为每个简化JSF方法的Seam功能重构代码。这包括以下内容:

  • make your JSF action listener classes into Seam components (i.e. add one annotation)
  • 将您的JSF动作侦听器类设置为Seam组件(即添加一个注释)

  • merge action listener and EJB classes (action listeners can be EJBs in Seam)
  • 合并动作侦听器和EJB类(动作侦听器可以是Seam中的EJB)

  • inject a Seam managed persistence context instead of your existing Hibernate session
  • 注入Seam托管持久化上下文而不是现有的Hibernate会话

  • simplify page navigation rules using Seam navigation syntax
  • 使用Seam导航语法​​简化页面导航规则

  • migrate views to Facelets, if you are still using JSP.
  • 如果您仍在使用JSP,请将视图迁移到Facelets。

Basically, Seam will probably give you lots of ways to simplify your existing code, so apply them one at a time to see how they work.

基本上,Seam可能会为您提供很多简化现有代码的方法,因此请逐一应用它们以查看它们的工作原理。

#2


0  

This seems to be part of the solution:

这似乎是解决方案的一部分:

http://www.mastertheboss.com/en/seam/63-jboss-seam-tutorial-1.html