samedi 16 mai 2015

javax.el.PropertyNotFoundException: Property 'invid' not found on type music.business.InvoiceDet. But it's there

I keep getting this "Property 'invid' not found on type music.business.InvoiceDet" error but I'm getting extremely frustrated because it is there, I don't understand why it cant find it.

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

My JSP

<%@page contentType="text/html" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://ift.tt/QfKAz6" %>
<%@taglib prefix="sql" uri="http://ift.tt/1cjm3bo"%>
<!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>

My InvoiceDet class

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;
}
}

I've tried it as:

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

And still nothing.

Any help would be appreciated.

Aucun commentaire:

Enregistrer un commentaire