Я хочу напечатать адрес доставки и адрес для выставления счета при получении. У меня есть форма адреса доставки, в которой я заполняю все данные клиента, но адрес не отображается на странице заказа. jsp. Я дал адрес магазина и показа, пожалуйста, проверьте путь, где я ошибаюсь.
Страница заказа. jsp
<strong>Billing Address</strong><br/>
${order.cart.customer.billingAddress.streetName}
<br/>
${order.cart.customer.billingAddress.city},
${order.cart.customer.billingAddress.state}
<br/>
${order.cart.customer.billingAddress.country}, ${order.cart.customer.billingAddress.zipCode}
</address>
<table class="table table-hover">
<thead>
<tr>
<td>Product</td>
<td>#</td>
<td class="text-center">Price</td>
<td class="text-center">Total</td>
</tr>
</thead>
<tbody>
<c:forEach var="cartItem" items="${order.cart.cartItems}">
<tr>
<td class="col-md-9"><em>${cartItem.product.productName}</em></td>
<td class="col-md-1" style="text-align: center">${cartItem.quantity}</td>
<td class="col-md-1" style="text-align: center">${cartItem.product.productPrice</td>
<td class="col-md-1" style="text-align: center">${cartItem.totalPrice}</td>
</tr>
</c:forEach>
Адрес доставки. jsp
<form:form action="${pageContext.request.contextPath}/confirmOrder" commandName="order" class="form-horizontal">
<h3>Shipping Address:</h3>
<div class="form-group">
<label for="shippingStreet">Street Name</label>
<form:input path="cart.customer.shippingAddress.streetName" id="shippingStreet" class="form-Control" />
</div>
<div class="form-group">
<label for="shippingApartmentNumber">Apartment Number</label>
<form:input path="cart.customer.shippingAddress.apartmentNumber" id="shippingApartmentNumber" class="form-Control" />
</div>
CustomerModel.class
public class CustomerModel implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE)
@Column(name="ID")
private int CustomerID;
@Column(name="First_Name")
private String customerFName;
@Column(name="Last_Name")
private String customerLName;
@Column(name="Email")
private String customerEmail;
@Column(name="Password")
private String customerPassword;
@Column(name="Contact")
private String customerContact;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "billingAddressId")
private BillingAddress billingAddress;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "shippingAddressId")
private ShippingAddress shippingAddress;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "id")
private Cart cart;
CustomerOrder.class
public class customerOrderModel {
@Id
@GeneratedValue
private int OrderID;
@OneToOne
@JoinColumn(name="ID")
private CustomerModel customer;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "billingAddressId")
private BillingAddress billingAddress;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "shippingAddressId")
private ShippingAddress shippingAddress;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "id")
private Cart cart;
Адрес доставки. java publi c class ShippingAddress реализует Serializable {
private static final long serialVersionUID = -4590474329622955062L;
@Id
@GeneratedValue
private int shippingAddressId;
private String streetName;
private String apartmentNumber;
private String city;
private String state;
private String country;
private String zipCode;
@OneToOne
private CustomerModel customer;