Announcement Announcement Module
Collapse
No announcement yet.
util:constant and map *values*? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • util:constant and map *values*?

    This little snippet:
    Code:
      <bean> 
        <property name="...">
          <map>
            <entry>
              <key
                <util:constant static-field="some.class.CONSTANT" />
              </key>
              <value><util:constant static-field="some.class.OTHER_CONSTANT" /></value>
            </entry>
          </map>
        </property>
      </bean>
    Seems to throw the error:
    Code:
    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.d: Invalid content was found starting with element 'util:constant'. No child element is expected at this point.
    	at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    Does this mean that constants can't be used as map values?

  • #2
    Originally posted by tunaranch View Post
    Does this mean that constants can't be used as map values?
    No it doesn't mean that. Just keep <value> tag out. Like that:
    Code:
    <entry>
      <key
        <util:constant static-field="some.class.CONSTANT" />
      </key>
      <util:constant static-field="some.class.OTHER_CONSTANT" />
    </entry>

    Comment

    Working...
    X