我的动作豆是
@HandlesEvent("getExcessesWidget")
public Resolution getExcessesWidget(){
primaryCO ="situser5";
excessList = excessManagementUiService.**getExcessesWidget**(primaryCO);
return new ForwardResolution("/WEB-INF/jsp/excessManagement/inbox.jsp");
}
GetExcessesWidget 方法 --
public FilteredUIExcessList getExcessesWidget(String primaryCO){
if(primaryCO != null && !primaryCO.trim().equals("")){
List<CrExcessMaster> crExcessMasterList = getExcessDbService().getExcessesWidget(primaryCO);
return UIBeanFormatter.formatWidgetBean(crExcessMasterList);
}
return null;
}
我的 UIBeanFormatter.formatWidgetBean 方法是
public static FilteredUIExcessList formatWidgetBean(List<CrExcessMaster> crExcessMasterList){
if(crExcessMasterList != null){
FilteredUIExcessList filteredUIExcessList = new FilteredUIExcessList();
List<CustomerExcessUIBean> widgetList = new ArrayList<CustomerExcessUIBean>();
for(CrExcessMaster crExcessMaster : crExcessMasterList){
ExcessUIBean excessUIBean = new ExcessUIBean();
excessUIBean.setExcessId(crExcessMaster.getExcessId().toString());
excessUIBean.setOpenDate(sdf.format(crExcessMaster.getOpenDate()));
excessUIBean.setExcessAmount(crExcessMaster.getMaxExcessAmount().toString());
excessUIBean.setDaValueForUser(Integer.parseInt(excessDbService.getDaLevelForUser("situser5")));
CustomerExcessUIBean customerExcessUIBean = new CustomerExcessUIBean();
customerExcessUIBean.setClientName(getClientName(crExcessMaster.getCif()));
customerExcessUIBean.setUltimateParent(getParentEntity(crExcessMaster.getCif()));
if (widgetList.contains(customerExcessUIBean)){
widgetList.get(widgetList.indexOf(customerExcessUIBean)).getExcessList().add(excessUIBean);
}
else{
customerExcessUIBean.getExcessList().add(excessUIBean);
widgetList.add(customerExcessUIBean);
}
}
filteredUIExcessList.setWidgetList(widgetList);
return filteredUIExcessList;
}
return null;
}
我的值在动作 bean 类中正确显示,但我无法在 jsp 文件中获取它我的 jsp 是
<s:form method="POST" action="/excessList.htm?getExcessesWidget=true"
id="form">
<table border="2px" bordercolor="black" width="100%" height="100%">
<tr>Excesses to be actioned
</tr>
<tr>
<th>Excess ID</th>
<th>Date</th>
<th>Client</th>
<th>Product</th>
<th>Amount</th>
<th>DA</th>
</tr>
<tbody>
<c:forEach items="${actionBean.excessList}" var="excess">
<c:forEach items="${excess.widgetList}" var="customerExcess">
<tr>
<td><c:out value="${customerExcess.excessId }"></c:out></td>
<td><c:out value="${customerExcess.openDate }"></c:out></td>
<td><c:out value="${customerExcess.excessAmount }"></c:out></td>
<td><c:out value="${customerExcess.daValueForUser }"></c:out></td>
</tr>
</c:forEach>
</c:forEach>
</tbody>
</table>
</s:form>
无法找到我的错误....任何帮助都非常感谢。提前致谢..