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

标签 java jsp exception properties

我正在使用 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/

相关文章:

c# - 是否有开放源代码项目在无异常(exception)的情况下实现相同的功能?

python - 如何立即重新引发任何工作线程中抛出的异常?

java - "Encapsulation helps make sure clients have no dependence on the choice of representation"

java - 将不同的图像放在 View /适配器中

java - java中河豚点击率的用户定义计数器增量函数

java - 获取 DocumentEvent 中的元素名称

java - 如何使用 JPA 将 List<String> 中的多个 String 元素保存到数据库中?

java - 如何使用 Spring MVC 更新我当前的用户数据?

javascript - 使用复选框从数据库获取行 ID

java - rawsql 中的关系运算符无效,相同的语句在 sqldeveloper 中有效