2 Replies Latest reply on Jun 21, 2006 7:53 AM by Thomas Heute

    JBossWorld Seam Lab Files

    Norman Richards Master

      For those of you who were not able to download the lab files during the hands on session due to network problems, I've uploaded the lab files from the Seam hands on session here: http://docs.jboss.org/seam/jbossworld-seam-lab.zip. Except for one minor correction, this is exactly the same distribution we used in the lab. I don't plan to keep this file online for a long time, so please download it soon if you need it. At some point in the future, I'll try and release an updated version that is more space efficient (not bundling the JBoss instance, for example) and that has better IDE instructions. (the lab instructions are for the command line, but it's trivial to run in eclipse if you are familiar with the IDE)

      The only other note is that some people reported security errors when viewing the instructions in IE due to the DHTML stuff. I don't have access to IE, but I'll be happy to post updated instructions if any of you windows guys can tell me what is wrong with IE when loading pages from disk. (but you should really be on firefox anyways, so...)

      If you have questions about the lab, this thread is the best place to ask.

        • 1. Re: JBossWorld Seam Lab Files
          Janel Miller Newbie

          I'm very new to seam, jsf, ejb3... But I thought I could get the demo running with the instructions provided. I'm having trouble with the Lab 3 Step 1. I don't know where to put the @End, is this in the NewHotelAction class?

          • 2. Re: JBossWorld Seam Lab Files
            Thomas Heute Master

            yes exactly.

            You just need to specify @End on the saveHotel() method, it is the last method that is interesting in our conversation. It is called from the JSF page and will let Seam destroy the conversation at the end of the method call.

            So your class should look like this now:

            package org.jboss.seam.example.booking;
            
            import java.util.*;
            
            import javax.ejb.*;
            import javax.persistence.*;
            
            import org.jboss.seam.annotations.*;
            import org.jboss.seam.annotations.datamodel.*;
            import org.jboss.seam.log.Log;
            
            @Stateless
            @Name("newHotel")
            public class NewHotelAction
             implements NewHotel
            {
             @PersistenceContext
             private EntityManager em;
            
             @In(create=true)
             private Hotel hotel;
            
             @Logger
             private Log log;
            
             @End
             public String saveHotel()
             {
             log.info("Saving hotel #{hotel}");
             em.persist(hotel);
             log.info("Created hotel id #{hotel.id}");
             return "/newHotelCreated.xhtml";
             }
            }
            


            Note that the conversation started when the user reached the newHotel.xhtml page thanks to the pages.xml file.