gpt4 book ai didi

javax.el.PropertyNotFoundException : Property 'Order' not found on type mine. 域.OrderHistory

转载 作者:太空宇宙 更新时间:2023-11-04 08:05:40 24 4
gpt4 key购买 nike

我正在使用 jaxb 将 xml 转换为 java beans。我有 orderhistory 类,其中包含订单列表。我正在 jsp 中获取 bean,但是当我尝试使用时, <c:forEach items="${OrderHistory.Order}" var="orderInfo">我得到javax.el.PropertyNotFoundException: Property 'Order' not found on type mine.domain.OrderHistory这是我的 orderhistory.java,

    @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);

我能够看到 java 端的 orderhistory bean 中填充的订单列表,但我无法在 jsp 上访问它。我究竟做错了什么???

最佳答案

您的属性名称是 order,而不是 Order。

关于javax.el.PropertyNotFoundException : Property 'Order' not found on type mine. 域.OrderHistory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12121634/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com