0

I have the following method annotated with @ModelAttribute

@ModelAttribute(value = "getRelatedNames")
public Map<String, String> getRelatedFormNames(String value) {
    // Logic to get and return the related names
}

How can I send the value String from the jsp? I have tried

<c:forEach var="nameMap" items="${getRelatedNames('testString')}">
    <option value="${nameMap.key}">${nameMap.value}</option>
</c:forEach>

and

<c:forEach var="nameMap" items="${getRelatedNames(value = 'testString')}">
    <option value="${nameMap.key}">${nameMap.value}</option>
</c:forEach>

but I get the following error:

The function getRelatedNames must be used with a prefix when a default namespace is not specified
SelketDaly
  • 539
  • 1
  • 5
  • 20

1 Answers1

0

This problem is related to EL version or missing: and already has an answer here

  1. The function test must be used with a prefix when a default namespace is not specified
  2. The function getMessageData must be used with a prefix
Community
  • 1
  • 1
KlajdPaja
  • 959
  • 1
  • 8
  • 17