Announcement Announcement Module
Collapse
No announcement yet.
how to evaluate variable in expression? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to evaluate variable in expression?

    hello every body.
    you suppose we have an applicationContext.xml file that defining beans in that.
    in this file we introduce a properties file like as this:
    Code:
        <context:property-placeholder location="[some address]/customProperties.properties"/>
    in customProperties file we have keys and values and for example you think we have:
    Code:
    colors=a,b,c,d
    in that.

    now we define a bean in applicationContext.xml like below:
    Code:
        <bean id="hat" class="org.myProject.Hat" scope="prototype">
            <property name="hatColor"
                      value="#{ T(org.apache.commons.lang.StringUtils).split(colors,',')}"/>
        </bean>
    my question is how we can evaluate colors values defined in customProperties file in hat bean and put splitted
    values of colors in
    Code:
    String[] hatColor;
    attribute of Hat class?


    so many thanks.
Working...
X