3 Replies Latest reply on Nov 23, 2006 7:13 AM by Pete Muir

    [booking example]: question regarding the HotelBookingAction

    Ning Zhao Apprentice

      The code in question:

      private Booking booking;

      I thought a booking without a Booking instance sounds weird, so that I removed the (required=false) for the @In annotation. But then got an org.jboss.seam.RequiredException. But in the RegisterAction.java, there is

      private User user;

      And it works. I looked for the more precise explanation about the "required" attribute, but the documentation didn't answer my question: Required from what? Required for what? (I thought a Booking instance should be required for a booking action, logically. But it seems that it is "required" from the context.... I changed the annotation to @In (create = true) and it worked again, but I guess the created instance would soon be an orphan in the heap since there is this line:
      booking = new Booking(hotel, user);

      in the bookHotel() method. )

      More changes I made to the code: after user login, the pageflow is managed by a jpdl file.