troubleshooting Question

List of object

Avatar of zolf
zolfFlag for United Arab Emirates asked on
JavaJSPJava EE
3 Comments2 Solutions550 ViewsLast Modified:
Hello there,

can somebody help me to put the order into the Order object.i get error
Type mismatch: cannot convert from List<Order> to Order

@Override
	public void saveOrder(List<Order> order)
	{
		// TODO Auto-generated method stub
		System.out.println(" list Size  "+order.size());
		
		List<NameValuePair> params = new ArrayList<NameValuePair>(order.size());
		
		params.add(new BasicNameValuePair("action", "save_order"));
		
		for(int i=0;i<order.size();i++)
		{
			Order order2 = order;
			System.out.println(" inside FOR " +order2.getCustomerID() +"  "+order2.getProductID()+"  "+order2.getQty());
			
			params.add(new BasicNameValuePair("amount_"+i, Integer.toString(order2.getQty())));
			params.add(new BasicNameValuePair("prod_id_"+i, Integer.toString(order2.getQty())));
		}
ASKER CERTIFIED SOLUTION
ksivananth
Vice President

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros