[英]Send parameter to @ModelAttribute annotated method from jsp
I have the following method annotated with @ModelAttribute
我有以下用
@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? 如何从jsp发送
value
String? 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
This problem is related to EL version or missing: and already has an answer here 此问题与EL版本有关或缺少:此问题已经在这里找到答案
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.