1 Reply Latest reply on Aug 3, 2007 6:51 AM by pmuir

    Use of underscore in identifiers problematic?

    dahm

      Hi,

      I had very mysterious problems when using underscores ('_') in component
      identifiers (that is @Name("iV_Belzig_Abrechnung"), e.g.).

      As well the code for the XHTML web pages as the stateful session bean and entity bean have been generated using XSLT. During transfomation whitespace and the like have been mapped to underscores.

      Now the effect with this was that sometimes Seam/JSF seemed to loose
      its conversation context. You hit a button and the associated action was
      not called. Instead, a new (stateful) session bean was generated and caused trouble,
      because it hadn't been properly initialized with the model class
      (@In/@Out was not fired). It looked as if the current page was to be
      redisplayed and the session bean methods where called to generate
      the content. Alas this caused NPE, because the backing model was null.

      I debugged this for two days and could not figure out what went wrong,
      since sometimes it seemed to work.
      Now a colleague suggest not to use underscores in the names and
      this actually solves the problem!!!

      How can that be, does anyone have an idea or a spec ready at hands
      that forbids the use of underscores in component names?

      Cheers
      Markus