1 Reply Latest reply on Jan 3, 2008 6:59 PM by Jacob Orshalick

    Name resolution for @In annotation

    Tres Spicher Newbie

      Hi all,

      I'm having a hard time understanding how Seam resolves names for injected values. Let's say somewhere in a JSF form we have the EL expression:

      #{aValue}


      And we have two Seam components (for illustration only, ignore other errors that might occur):

      @Name("class1")
      public class Class1 {
       @In
       private String aValue;
      }


      and

      @Name("class2")
      public class Class2 {
       @In
       private String aValue;
      }


      How do I know which class submitting the form will affect? When I try to qualify the EL expression (e.g. #{class1.aValue}) I get an exception to the effect of:
      Property 'aValue' not found on type Class1.


      I'm sure I'm just not understanding this right, so I would greatly appreciate a clear explanation.

        • 1. Re: Name resolution for @In annotation
          Jacob Orshalick Apprentice

           

          "tresspicher" wrote:
          Let's say somewhere in a JSF form we have the EL expression:

          Code:

          #{aValue}


          You have to outject aValue to access it this way. (i.e. @Out must be placed on the attribute).

          "tresspicher" wrote:
          How do I know which class submitting the form will affect?


          It depends on which component gets invoked during the request. For each component that gets invoked the bijections will occur for that component (injection before the invocation and disinjection afterward). Hope that helps.

          "tresspicher" wrote:
          When I try to qualify the EL expression (e.g. #{class1.aValue}) I get an exception ...


          You have no getter for aValue. The expression above resolves to class1.getAValue() which does not exist.