This content has been marked as final.
Show 2 replies
-
1. Re: JBossWorld Seam Lab Files
janel10 Jun 20, 2006 2:48 PM (in response to norman.richards)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
theute Jun 21, 2006 7:53 AM (in response to norman.richards)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.