Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 11th, 2013  |  syntax: None  |  size: 3.77 KB  |  views: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. HashMap<String, HashMap<Integer, String>> hMap = new HashMap<String, HashMap<Integer,String>>();
  2.  
  3. HashMap<Integer, String> xx = new HashMap<Integer, String>();
  4. xx.put (1, "ABC");
  5. xx.put (2, "def");
  6.  
  7. HashMap<Integer, String> yy = new HashMap<Integer, String>();
  8. yy.put (1, "ABC");
  9. yy.put (2, "def");
  10.  
  11. hMap.put ("20120826", xx);
  12. hMap.put ("20120827", yy);
  13.  
  14. request.setAttribute("hoursByProjectByDay", hMap);
  15.  
  16. ArrayList<String> displyDtArr = new ArrayList<String>();
  17. displyDtArr.add("20120826");
  18. displyDtArr.add("20120827");
  19. request.setAttribute("displayDates", displyDtArr);
  20.  
  21. ArrayList<Integer> projects= new ArrayList<Integer>();
  22. projects.add(1)
  23. projects.add(2);
  24. request.setAttribute("projects", projects);
  25.  
  26.  
  27.       <c:forEach var="pl" items="${projects}">
  28.  <c:forEach var="displayDt" items="${displayDates}">
  29.     <c:forEach var="hoursByProjByday" items="${hoursByProjectByDay[displayDt]}">
  30.             <c:set var="userHour"  value="${hoursByProjByday[pl]}"/>
  31.  
  32.         </c:forEach>
  33.     </c:forEach>
  34. </c:forEach>
  35.        
  36. org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
  37. org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)
  38. org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
  39. org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
  40. javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  41. edu.uchospitals.timetrack.FrontController.dispatch(FrontController.java:121)
  42. edu.uchospitals.timetrack.FrontController.processRequest(FrontController.java:116)
  43. edu.uchospitals.timetrack.FrontController.doPost(FrontController.java:152)
  44. javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
  45. javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  46.  
  47. root cause
  48. javax.el.PropertyNotFoundException: Property '1' not found on type java.util.HashMap$Entry
  49. javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
  50. javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
  51. javax.el.BeanELResolver.property(BeanELResolver.java:279)
  52. javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
  53. javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
  54. org.apache.el.parser.AstValue.getValue(AstValue.java:97)
  55. org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
  56. org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:923)
  57. org.apache.jsp.WEB_002dINF.jsp.main_jsp._jspx_meth_c_005fset_005f0(main_jsp.java:548)
  58. org.apache.jsp.WEB_002dINF.jsp.main_jsp._jspx_meth_c_005fforEach_005f5(main_jsp.java:513)
  59. org.apache.jsp.WEB_002dINF.jsp.main_jsp._jspx_meth_c_005fforEach_005f4(main_jsp.java:471)
  60. org.apache.jsp.WEB_002dINF.jsp.main_jsp._jspx_meth_c_005fforEach_005f1(main_jsp.java:338)
  61. org.apache.jsp.WEB_002dINF.jsp.main_jsp._jspService(main_jsp.java:138)
  62. org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  63. javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  64. org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
  65. org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
  66. org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
  67. javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  68. edu.uchospitals.timetrack.FrontController.dispatch(FrontController.java:121)
  69. edu.uchospitals.timetrack.FrontController.processRequest(FrontController.java:116)
  70. edu.uchospitals.timetrack.FrontController.doPost(FrontController.java:152)
  71. javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
  72. javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
  73.        
  74. <c:forEach var="project" items="${projects}">
  75.     <c:forEach var="displayDt" items="${displayDates}">
  76.         <c:forEach var="userHours" items="${hoursByProjectByDay[displayDt][project]}">
  77.              <br/>${userHours}
  78.         </c:forEach>
  79.     </c:forEach>
  80. </c:forEach>
clone this paste RAW Paste Data