7.4. Configurable property types

Properties of string, primitive, or primitive wrapper type are configured as follows:
  • org.jboss.seam.core.manager.conversationTimeout 60000
  • <core:manager conversation-timeout="60000"/>
<component name="org.jboss.seam.core.manager"> 
  <property name="conversationTimeout">60000</property> 
</component>
Even maps with String-valued keys and string, or primitive values are supported:
<component name="issueEditor">
  <property name="issueStatuses">
    <key>open</key> <value>open issue</value>
    <key>resolved</key> <value>issue resolved by developer</value>
    <key>closed</key> <value>resolution accepted by user</value>
  </property>  
</component>
When configuring multi-valued properties, Seam preserves the order of attributes set out in the components.xml file by default. If SortedSet/SortedMap are used, Seam refers to TreeMap/TreeSet. If the property has a concrete type (LinkedList, for example) Seam uses that type.
You can also override the type by specifying a fully qualified class name:
<component name="issueEditor">
  <property name="issueStatusOptions" type="java.util.LinkedHashMap">
    <key>open</key> <value>open issue</value>
    <key>resolved</key> <value>issue resolved by developer</value>
    <key>closed</key> <value>resolution accepted by user</value>
  </property> 
</component>
You can link components with a value-binding expression. Note that as this occurs upon component instantiation, not invocation, this is quite different to injection with @In. It is more similar to the dependency injection facilities offered by traditional Inversion of Control containers such as JavaServer Faces (JSF) or Spring.
<drools:managed-working-memory name="policyPricingWorkingMemory" rule-base="#{policyPricingRules}"/>
<component name="policyPricingWorkingMemory" class="org.jboss.seam.drools.ManagedWorkingMemory"> 
  <property name="ruleBase">
   #{policyPricingRules}
  </property>
</component>
Seam also resolves EL expression strings prior to assigning the initial value to the bean property of the component, so some contextual data can be injected into components:
<component name="greeter" class="com.example.action.Greeter">
  <property name="message">
    Nice to see you, #{identity.username}!
  </property>
</component>
However, there is one important exception: if the initial value is assigned to either a Seam ValueExpression or MethodExpression, then the evaluation of the EL is deferred, and the appropriate expression wrapper is created and assigned to the property. The message templates on the Home component of the Seam Application Framework are a good example of this:
<framework:entity-home name="myEntityHome" class="com.example.action.MyEntityHome" entity-class="com.example.model.MyEntity" created-message="'#{myEntityHome.instance.name}'has been successfully added."/>
Within the component, you can access the expression string by calling getExpressionString() on either ValueExpression or MethodExpression. If the property is a ValueExpression, resolve the value with getValue(). If the property is a MethodExpression, invoke the method with invoke({Object arguments}). To assign a value to a MethodExpression property, the entire initial value must be a single EL expression.