Defining spring bean using a class with generic parameters

Spring has no generic support for that case, but the compiler just creates a class cast in this case. So the right solution is:

<bean id="myClass" class="example.MyClass">
  <property name="foo">
    <list value-type="example.MyEnumType">
      <value>ONE</value>
      <value>TWO</value>
    </list>
  </property>
</bean>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)