2009-09-09 77 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的例子,你會有一個很好的參考關於好實踐。