Seam/Creating

From Wikibooks, open books for an open world
< Seam
Jump to: navigation, search
  1. In Eclipse, use the wizard to create a new Seam project called "myProject", make sure to choose "EAR" as the project type, as WAR files do not support EJB3
  2. Eclipse will create four separate projects
    • myProject
    • myProject-ear
    • myProject-ejb
    • myProject-test
  3. Of these, only two areas are, for now, of interest to us
    • The "WebContent" folder in the "myProject" project
      • This will contain all your JSF pages, images, CSS files etc. Basically, everything to do with the UI.
    • The "ejbModule" folder in the "myProject-ejb" project
      • This will contain all your Java classes.
      • Although there is a SRC directory under the "myProject" folder, you can't use classes there as fully working Seam components
      • Since most of the classes should be regarding business logic or persistance, they should be EJBs anyway
  4. To help clear some of the clutter set the filter to hide "Libraries from external"
  5. Turn off the Hibernate logging by opening "persistence.xml" (located in myProject-ejb --> ejbModule --> META-INF) and setting the property "hibernate.show_sql" to "false". You don't have to do this, but I find Hibernate to be pretty chatty and the messages usually don't help me much. You can always turn it back on later if needed.