Forward to the JSP of which this piece of code caused an error:
up vote
0
down vote
favorite
The Bean and JSP are below:
public class Order
private String o_id;
private User user;
private Timestamp time;
private int state;
private String address;
private double total;
public List<OrderItem> getOrderItemList()
return OrderItemList;
public void setOrderItemList(List<OrderItem> orderItemList)
OrderItemList = orderItemList;
<c:forEach items="$orders" var="order"> // Outer loop for orders
<c:forEach items="$order.OrderItemList" var="item"> // Inner loop for items of an order
And I'm sure that OrderItemList isn't empty and is truly transferred to the JSP file.
In my limited experience with Servlet, I think $order.OrderItemList
is not the correct expression when the element of the Bean is a List. Is that true?
jsp servlets
add a comment |
up vote
0
down vote
favorite
The Bean and JSP are below:
public class Order
private String o_id;
private User user;
private Timestamp time;
private int state;
private String address;
private double total;
public List<OrderItem> getOrderItemList()
return OrderItemList;
public void setOrderItemList(List<OrderItem> orderItemList)
OrderItemList = orderItemList;
<c:forEach items="$orders" var="order"> // Outer loop for orders
<c:forEach items="$order.OrderItemList" var="item"> // Inner loop for items of an order
And I'm sure that OrderItemList isn't empty and is truly transferred to the JSP file.
In my limited experience with Servlet, I think $order.OrderItemList
is not the correct expression when the element of the Bean is a List. Is that true?
jsp servlets
The JavaBean property is namedorderItemList
, notOrderItemList
. And you should respect the Java naming conventions and rename the field to `orderItemList, too. The field would then have the same name as the property, which would make it less confusing.
– JB Nizet
Nov 9 at 13:13
oh my god. the problem is really what you said. one hour is for coding with ten hours debugging. it almost makes me crazy.
– Ace Ace
Nov 9 at 13:23
@JBNizet and thanks for your help.
– Ace Ace
Nov 9 at 13:24
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
The Bean and JSP are below:
public class Order
private String o_id;
private User user;
private Timestamp time;
private int state;
private String address;
private double total;
public List<OrderItem> getOrderItemList()
return OrderItemList;
public void setOrderItemList(List<OrderItem> orderItemList)
OrderItemList = orderItemList;
<c:forEach items="$orders" var="order"> // Outer loop for orders
<c:forEach items="$order.OrderItemList" var="item"> // Inner loop for items of an order
And I'm sure that OrderItemList isn't empty and is truly transferred to the JSP file.
In my limited experience with Servlet, I think $order.OrderItemList
is not the correct expression when the element of the Bean is a List. Is that true?
jsp servlets
The Bean and JSP are below:
public class Order
private String o_id;
private User user;
private Timestamp time;
private int state;
private String address;
private double total;
public List<OrderItem> getOrderItemList()
return OrderItemList;
public void setOrderItemList(List<OrderItem> orderItemList)
OrderItemList = orderItemList;
<c:forEach items="$orders" var="order"> // Outer loop for orders
<c:forEach items="$order.OrderItemList" var="item"> // Inner loop for items of an order
And I'm sure that OrderItemList isn't empty and is truly transferred to the JSP file.
In my limited experience with Servlet, I think $order.OrderItemList
is not the correct expression when the element of the Bean is a List. Is that true?
public class Order
private String o_id;
private User user;
private Timestamp time;
private int state;
private String address;
private double total;
public List<OrderItem> getOrderItemList()
return OrderItemList;
public void setOrderItemList(List<OrderItem> orderItemList)
OrderItemList = orderItemList;
<c:forEach items="$orders" var="order"> // Outer loop for orders
<c:forEach items="$order.OrderItemList" var="item"> // Inner loop for items of an order
public class Order
private String o_id;
private User user;
private Timestamp time;
private int state;
private String address;
private double total;
public List<OrderItem> getOrderItemList()
return OrderItemList;
public void setOrderItemList(List<OrderItem> orderItemList)
OrderItemList = orderItemList;
<c:forEach items="$orders" var="order"> // Outer loop for orders
<c:forEach items="$order.OrderItemList" var="item"> // Inner loop for items of an order
jsp servlets
jsp servlets
edited Nov 14 at 20:08
Peter Mortensen
13.4k1983111
13.4k1983111
asked Nov 9 at 9:47
Ace Ace
277
277
The JavaBean property is namedorderItemList
, notOrderItemList
. And you should respect the Java naming conventions and rename the field to `orderItemList, too. The field would then have the same name as the property, which would make it less confusing.
– JB Nizet
Nov 9 at 13:13
oh my god. the problem is really what you said. one hour is for coding with ten hours debugging. it almost makes me crazy.
– Ace Ace
Nov 9 at 13:23
@JBNizet and thanks for your help.
– Ace Ace
Nov 9 at 13:24
add a comment |
The JavaBean property is namedorderItemList
, notOrderItemList
. And you should respect the Java naming conventions and rename the field to `orderItemList, too. The field would then have the same name as the property, which would make it less confusing.
– JB Nizet
Nov 9 at 13:13
oh my god. the problem is really what you said. one hour is for coding with ten hours debugging. it almost makes me crazy.
– Ace Ace
Nov 9 at 13:23
@JBNizet and thanks for your help.
– Ace Ace
Nov 9 at 13:24
The JavaBean property is named
orderItemList
, not OrderItemList
. And you should respect the Java naming conventions and rename the field to `orderItemList, too. The field would then have the same name as the property, which would make it less confusing.– JB Nizet
Nov 9 at 13:13
The JavaBean property is named
orderItemList
, not OrderItemList
. And you should respect the Java naming conventions and rename the field to `orderItemList, too. The field would then have the same name as the property, which would make it less confusing.– JB Nizet
Nov 9 at 13:13
oh my god. the problem is really what you said. one hour is for coding with ten hours debugging. it almost makes me crazy.
– Ace Ace
Nov 9 at 13:23
oh my god. the problem is really what you said. one hour is for coding with ten hours debugging. it almost makes me crazy.
– Ace Ace
Nov 9 at 13:23
@JBNizet and thanks for your help.
– Ace Ace
Nov 9 at 13:24
@JBNizet and thanks for your help.
– Ace Ace
Nov 9 at 13:24
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53223334%2fforward-to-the-jsp-of-which-this-piece-of-code-caused-an-error-cforeach-items%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The JavaBean property is named
orderItemList
, notOrderItemList
. And you should respect the Java naming conventions and rename the field to `orderItemList, too. The field would then have the same name as the property, which would make it less confusing.– JB Nizet
Nov 9 at 13:13
oh my god. the problem is really what you said. one hour is for coding with ten hours debugging. it almost makes me crazy.
– Ace Ace
Nov 9 at 13:23
@JBNizet and thanks for your help.
– Ace Ace
Nov 9 at 13:24