我正在使用jaxb將我的xml轉換爲java bean。我有訂單歷史課,將有訂單清單。我正在JSP中的綠豆,但是當我嘗試使用, <c:forEach items="${OrderHistory.Order}" var="orderInfo">
我得到javax.el.PropertyNotFoundException: Property 'Order' not found on type mine.domain.OrderHistory
這裏是我的orderhistory.java,javax.el.PropertyNotFoundException:在類型mine.domain.OrderHistory上找不到屬性'Order'
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"totalPages",
"order",
})
@XmlRootElement(name = "OrderHistory")
public class OrderHistory
implements Serializable
{
private final static long serialVersionUID = -6026937020915831338L;
protected int totalPages;
@XmlElement(nillable = true)
protected List<Order> order;
public List<Order> getOrder() {
if (order == null) {
order = new ArrayList<Order>();
}
return this.order;
}
OrderHistory oh = // i am populating it here
TypedProperty responseProperties = new TypedProperty();
responseProperties.put("OrderHistory",oh);
setResponseProperties(responseProperties);
我能看到居住在orderhistory豆中的順序列表Java方面,但我不能在jsp上訪問它。我究竟做錯了什麼???
只是爲了驗證 - 你的意思是在你的EL表達式中的orderHistory或OrderHistory?我想知道是否試圖靜態訪問該方法。 – JamesB
@JamesB看我的編輯。我在我的Java中使用.. – coderman