Announcement Announcement Module
Collapse
No announcement yet.
setting proerty using expression Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • setting proerty using expression

    I have a class with a property int ,but in the configuration file I have set the property as follow

    Code:
    class A{
    
    int k;
    }
    
    <bean id ="j" class ="A">
    
    <property name="k" value="Java.sql.Types.Numeric">
    
    </bean>
    I got exception

  • #2
    Hi,
    The problem is that you are trying to set a property with the value of a static property of other class. In this case you must use the following:

    Code:
       <bean id ="j" class ="A">
            <property name="k">
                <util:constant static-field= "java.sql.Types.NUMERIC"/>
            </property>
        </bean>
    Regards

    Comment

    Working...
    X