我试图在jsp中迭代map类型的变量..但结果页面什么也没显示
产品详情属于类型Map<String,String>
//行动
public String execute() {
productDetails = displayServiceDao.fetchProductDetailsService( product );}
public Map<String , String> getProductDetails() {
return productDetails;
}
public void setProductDetails( Map<String , String> productDetails ) {
this.productDetails = productDetails;
}
//jsp
<s:iterator var="studentEntry" value="productDetails.entrySet()">
<s:property value="%{#studentEntry.getKey()}"/>
<s:property value="%{#studentEntry.getValue()}"/>
</s:iterator>
注意:我不是在动作类中向映射添加值..我通过函数的返回值添加它