title: How to access bean attribute in JSP?
body: <p>How can we access the bean attribute in JSP?<br />
  I tried</p>
  <pre><code>&lt;core:forEach var=&quot;header&quot; items=&quot;${command.headerList}&quot; &gt;
  &lt;td&gt;&lt;core:out value=&quot;${header.columnName}&quot;/&gt;&lt;/td&gt;
  &lt;/core:forEach&gt;
  </code></pre>
  <p>where headerList is the list of <em>myBean</em> which is having the attribute <em>columnName</em> [ getter / setter are defined in the class ]</p>
  <p><code>Expected:</code> it should print the value in columnName<br />
  <code>Actual:</code>  it is not printing anything at all</p>
  <p>also how can i access the nth element in the List? i tried</p>
  <pre><code>${command.headerList[i]}
  </code></pre>
  <p><code>Output:</code> nothing displayed.</p>
  <h1>Edit:#</h1>
  <p>When i write</p>
  <pre><code>${command.headerList}
  </code></pre>
  <p>it displays</p>
  <p>com.bean.MyBean@14ecb90, com.bean.MyBean@169b35, com.bean.MyBean@27d572</p>
  <p><code>This is just to let you know that the list is having something</code></p>
  <p>and when i write</p>
  <pre><code>${header}
  </code></pre>
  <p>inside the forEach loop it displays:</p>
  <p>javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects$7@d9d714</p>
  <p><code>That means even header is having value, then why i am unable to print values using</code></p>
  <pre><code>${header.columnName}
  </code></pre>