As a Sean beginner I was wondering what exactly the @create= true annotation does inside of the @In injection declaration. Here is the mystery unveiled:
– When a Seam component is requested, the container looks into the lowest context to see if its there, if not the next context up in the hierarchy is searched.
– If no instance is found thats when the above mentioned annotations kick in:
- If the injection that triggered the search is declared as @create=true, the component is instantiated
- If the component is marked with a @Autocreate annotation on the class level, a new instance will be created in any case and the @create=true annotation becomes obsolete.