我有一个哈希图如下:
HashMap<String, Object> myHashMap = new HashMap<String, Object>();
其中的数据如下所示:
{CompanyName=null, CompanyId=null}
我想迭代它并在我的表示层中显示它的值。我将它添加到我的模型中,如下所示:public String
showPage(Map model)
{
HashMap<String, Object> myHashMap = new HashMap<String, Object>();
model.put("company", myHashMap);
return "page";
}
我的 JSP
<h1>${companyName}</h1>
<fieldset>
<p>
<form:label path="companyName" cssErrorClass="form-error">Issuer Name</form:label>
</p>
</fieldset>
<input type="submit" value="Next" class="round blue ic-right-arrow" />
我收到以下错误:
Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'companyName' of bean class [java.util.HashMap]: Bean property 'companyName' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?