Results 1 to 2 of 2

Thread: setting proerty using expression

  1. #1

    Default 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. #2
    Join Date
    May 2010
    Location
    Lima, Perú
    Posts
    26

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •