2009-09-09 68 views

回答

1

也许文章here之一可能会有所帮助。

+0

没有那么有用,任何其他文档或链接 – user118802 2009-09-10 11:56:41

1

如果您在寻找特定主题的建议和提示,那么您会在Seam参考本身中找到许多整洁的技巧和建议。对于很多主题,有不止一个例子,它们向你展示了如何以最优雅的方式来做到这一点。形成日志消息。

最新的是http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html

1
  • 始终通过使用seam-gen命令行

从<SEAM_HOME>目录下生成你的Seam项目,叫

seam setup 

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

担心你不需要JBoss应用程序服务器。您可以使用另一种,如果你想

然后

seam create-project 

在NetBeans中

  1. 文件>打开项目按Ctrl + Shift + O
  2. 导航到生成的项目目录
  3. 没有别的

如果您使用的是Eclipse,请参阅Getting started with Seam, using JBoss Tools

  • 始终使用SeamT​​est在测试你的Seam项目(允许你测试应用程序服务器之外的应用程序)仔细

    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(); 
    
        } 
    } 
    
  • 读缝在行动

+0

这个建议背后的原因是什么总是使用seam-gen生成Seam项目? – Kaitsu 2010-03-01 14:55:55

+0

@Kaitsu看到我自己的答案:http://stackoverflow.com/questions/2281418/should-i-start-my-seam-project-from-scratch-or-from-a-seam-gen-generated-project/ 2285859#2285859 – 2010-03-01 15:21:29

0

我想你看看Seam的例子,你会有一个很好的参考关于好实践。