javax.el.PropertyNotFoundException:Property' invid'在类型music.business.InvoiceDet上找不到。但它就在那里

时间:2015-05-16 23:11:47

标签: java jsp java-ee jpa web-applications

我一直得到这个"财产' invid'没有找到类型music.business.InvoiceDet"错误,但我非常沮丧,因为它在那里,我不明白为什么它找不到它。

org.apache.jasper.JasperException: An exception occurred processing JSP page /invoicesDet.jsp at line 21

18:             </tr>
19:             <c:forEach var="i" items="${invoicesdet}">
20:             <tr>
21:                 <td>${i.invid}</td>
22:                 <td>${i.prod_id}</td>
23:                 <td>${i.quantity}</td>
24:             </tr>

javax.el.PropertyNotFoundException: Property 'invid' not found on type music.business.InvoiceDet

我的JSP

<%@page contentType="text/html" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Invoice Maintenance</title>
    <link rel="stylesheet" href="<c:url value='/styles/main.css'/> ">
</head>
<body>
        <h1>Invoice Details</h1>
    <table>
        <tr>
            <th>Invoice ID</th>
            <th>Product ID</th>
            <th>Quantity</th>
        </tr>
        <c:forEach var="i" items="${invoicesdet}">
        <tr>
            <td>${i.invid}</td>
            <td>${i.prod_id}</td>
            <td>${i.quantity}</td>
        </tr>
        </c:forEach>
    </table>

  </body>
</html>

我的InvoiceDet类

package music.business;

import java.io.Serializable;
import java.text.NumberFormat;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity(name = "inv_content")
public class InvoiceDet implements Serializable {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
 private String Inv_id;
 private String Prod_id;
 private String quantity;


public InvoiceDet() {
    Inv_id = "";
    Prod_id = "";
    quantity = "";
}

 public void setInv_id(String invid) {
   Inv_id = invid;
}

public String getInv_id() {
   return Inv_id;
}


public void setProd_id(String prod_id) {
    this.Prod_id = prod_id;
}

public String getProd_id() {
    return Prod_id;
}

    public void setquantity(String quantity) {
    this.quantity = quantity;
}

public String getquantity() {
    return quantity;
}
}

我已经尝试过:

 public void setInv_id(String invid) {
   this.Inv_id = invid;
}

仍然没有。

任何帮助都将不胜感激。

0 个答案:

没有答案