Skip to Content
0
Former Member
Jan 23, 2009 at 03:42 PM

Displaying Hashmap values on Jsp retured by a Z Class

1308 Views

Hi

z Java class is setting request.attribute for a hashmap(Key, value) type.

I need to display the values of hashmap on the JSP.

Please help!

Thanks

ET

			int alPriceSize = alPriceCondPanel.size();
			String salesItemProductId = item_ID.getProductId().toString();
			String itemIpcCondition = null;
			
			HashMap z_itemprz = new HashMap();

					for (int i = 0; i < ipcPricingCond.length; i++) {
						IPCPricingCondition ipcCondition = ipcPricingCond<i>;


						if (ipcCondition.getConditionTypeName().equalsIgnoreCase("ZCM1"))
						{
						  String condDiscountValue = ipcCondition.getConditionValue();
						  String condDiscountTypeName = ipcCondition.getConditionTypeName();
						  String ipcCondDiscountRate = ipcCondition.getConditionRate();
						  String ipcCondDiscountDesc = ipcCondition.getDescription();
						  String condDiscountCurr = ipcCondition.getConditionCurrency();
						  String condDiscountCounter = ipcCondition.getCounter();

						  log.error("IPC Discount Counter: "+condDiscountCounter);
						  log.error("Discount value: "+condDiscountValue);
						  log.error("Discount Description: "+ipcCondDiscountDesc);

						  String chDot = ".";
						  int indxDot = condDiscountValue.indexOf(chDot, 3);
						  String condFinalDiscountVal = condDiscountValue.substring(0, indxDot);
						  String space = " ";
						  condDiscountCurr = condDiscountCurr.concat(space);

						  String ipcPhsDiscount = condFinalDiscountVal.concat(condDiscountCurr);

						  log.error("PHS Dicount Value: "+ipcPhsDiscount);
						  request.setAttribute("ipcPhsDiscount", ipcPhsDiscount);
						  z_itemprz.put( item_ID.getProductId().toString(),ipcPhsDiscount);
						}
					   if (ipcCondition.getConditionTypeName().equalsIgnoreCase("ZA01"))
						{
							String condListValue = ipcCondition.getConditionValue();
							String condListTypeName = ipcCondition.getConditionTypeName();
							String condListRate = ipcCondition.getConditionRate();
							String condListDesc = ipcCondition.getDescription();
							String condListCurr = ipcCondition.getConditionCurrency();
							String condListCounter = ipcCondition.getCounter();

							log.error("IPC List Counter: "+condListCounter);
							log.error("List Price value: "+condListValue);
							log.error("List Price Description: "+condListDesc);

							String chDot = ".";
							int indxDot = condListRate.indexOf(chDot, 0) + 3;
							String condFinalListPrice = condListRate.substring(0, indxDot);

							String space = " ";
							condListCurr = condListCurr.concat(space);

							String ipcPhsListPrice = condFinalListPrice.concat(condListCurr);
//							String ipcPhsListPrice = itemProdId.concat(ipcPhsListPrice1);
							log.error("PHS List Value : "+ipcPhsListPrice);
							request.setAttribute("ipcPhsListPrice", ipcPhsListPrice);
						}
					   }
			       request.setAttribute("z_itemprz", z_itemprz);