0 Replies Latest reply on Jul 28, 2009 4:09 PM by Giampaolo tomassoni

    JSF lifecycle and EVENT-scoped Seam components

    Giampaolo tomassoni Newbie


      I'm using jboss-seam-2.1.1.GA + jboss-5.0.1.GA + the JSF reference-implementation shipped with the latter.

      I see a behaviour which seems a problem to me, but I don't know if it is instead by design.

      I have a jsf page referencing the following Seam components:

      public class OrderManager {
      public class OrderEventManager {
          private OrderManager orderManager;
          public void _create() {
           // some use of orderManager

      Where you may see the bo.orderEventManager component uses the bo.orderManager at creation time.

      In the _create method some fields of the bo.orderEventManager components are initialized and then referenced in the JSF page. You may think to the bo.orderEventManager component as a value cache for stuff which is based on values from the bo.orderEventManager one.

      Things are fine on a JSF get request, but they are not after a JSF post one: I would expect that bo.orderEventManager be retained during JSF Apply Request Values, Process Validations, Update Model Values and, maybe, Invoke Application, and discarded right before the Render Response one. This seems reasonable to me because the model values changed after the Update Model Value phase, thereby the Seam EVENT scope should not span after it.

      Instead, I see the instance of bo.orderEventManager is not discarded and instead reteined for the whole Render Response phase.

      It this by design or instead some kind of flaw?

      Thank you,