• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

forEach prints Address Location

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

I populate a List in my servlet and iterate over it in my JSP using the forEach tag. It prints the value of the address location
instead of the content in the List. Below is the code snippet. Please let me know what I'm missing.


I set it in the session variable. In the JSP I get this attribute and iterate over it


and it prints

javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects$7@caba7f

5 times. (List contains 5 items)
It is the same value for every td element.

Please let me know how to correct it.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"header" is an implicit object used by EL. Rename your variable to something else.
 
Soumya Manjunath
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Christophe. I changed the variable name and it works now:)
 
reply
    Bookmark Topic Watch Topic
  • New Topic