title: How to use List<Object> in Struts?
body: <p>Im trying to write a code using the <strong>struts framework</strong>.</p>
  
  <p>Im new in struts, I do not have experience in this field.</p>
  
  <p>What i want to do, its to use the <strong>list of object in struts</strong>.</p>
  
  <p>Assume that we have the java class extends from ActionForm as bellow:</p>
  
  <p><strong>ResumeMessages.java:</strong></p>
  
  <pre><code>public class ResumeMessages_Form extends ActionForm{
  
  private List&lt;Message&gt; listallmessages; // this is the list wich i want to use it
  private DbMessage DbMessage; // a simple java class to connect from JDBC to xamp ...
  
  public ResumeMessages_Form() {
      super();
      DbMessage = new DbMessage();
      try {
          listallmessages = DbMessage.List_Messages(); // return list of all messages in the database
      } catch (SQLException ex) {
          Logger.getLogger(ResumeMessages_Form.class.getName()).log(Level.SEVERE, null, ex);
      }
  }
  
  public List&lt;Message&gt; getListallmessages() {
      return listallmessages;
  }
  
  public void setListallmessages(List&lt;Message&gt; listallmessages) {
      this.listallmessages = listallmessages;
  }
  
  @Override
  public String toString() {
      return "ResumeMessages_Form{" + "listallmessages=" + listallmessages + ", DbMessage=" + DbMessage + '}';
  }
  
  @Override
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      return errors;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And assume that i want to use the list '<strong><em>listallmessages</em></strong>' in the jsp file as bellow:</p>
  
  <p><strong>Resum.jsp:</strong></p>
  
  <pre><code>  &lt;%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %&gt;
      &lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;title&gt;Untitled Page&lt;/title&gt;
                   &lt;jsp:include page="/files/resumemessages/resumemessages_style.jsp"/&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
          &lt;html:form action="/resum" method="post"&gt;
  &lt;table&gt;
  &lt;% for (int i=0;i&lt;listallmessages.size();i++){%&gt;
      &lt;tr&gt;&lt;td&gt; &lt;%= listallmessages.get(i).message_name %&gt;
  &lt;/td&gt;&lt;/tr&gt;
  &lt;%}%&gt;
  &lt;/table&gt;
  &lt;/html:form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Notice</strong>: I have no problem with the <strong>struts-config.xml</strong>, I know well what i will do in the struts-config.xml, just I need someone to help me to use List in jsp file using struts.</p>
  
  <p>Thanks a lot :)
  Binary Man </p>