Seam最佳实践

时间:2009-09-09 08:31:19

标签: seam

是否有关于接缝最佳实践的文件或文章。

4 个答案:

答案 0 :(得分:1)

也许其中一篇文章here可能有所帮助。

答案 1 :(得分:1)

如果您寻找特定主题的建议和提示,您会在Seam参考中找到许多巧妙的技巧和建议。对于很多主题,有不止一个例子,他们会告诉你如何以最优雅的方式做到这一点,例如:形成日志消息。

最新版本位于http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html

答案 2 :(得分:1)

  • 始终使用seam-gen命令行生成您的Seam项目

来自< SEAM_HOME>目录,调用

seam setup

回答一些问题:项目工作区,JBoss主目录,项目名称等

注意你不需要JBoss应用服务器。如果需要,您可以使用另一个

然后

seam create-project

在NetBeans中

  1. 文件>打开项目 Ctrl + Shift + o
  2. 导航至生成的项目目录
  3. 没有别的
  4. 如果您使用的是Eclipse,请参阅Getting started with Seam, using JBoss Tools

    • 始终使用SeamT​​est测试您的Seam项目(允许您在Application Server外测试您的应用程序)

      public class UserTest extends SeamTest {
      
          @Test
          public void saveUser() throws Exception {
      
              new FacesRequest("/user/save.xhtml") {
      
                  // beforeRequest set up any request parameters for the request
                  protected void beforeRequest() {
                      setParameter("someAttribute", "someValue");
                  }
      
                  protected void updateModelValues() {
                      setValue("#{user.name}", "Foo");
                      setValue("#{user.category}", UserCategory.GOLD);
                  }
      
                  protected void invokeApplication() {
                      invokeMethod("#{userRepository.saveUser(user)}");
                  }
      
              }.run();
      
          }
      }
      
    • 仔细阅读Seam in Action

答案 3 :(得分:0)