I am using java springs and jstl.I want to populate an HTML table with the following code.This code works fine But my problem is i have to create object each time maualy for a new row.help me to do it dynmially
Java Code:
 List<Company> companyList;
 srs = tpl.queryForRowSet("select CompanyName,CompanyAddress from company");
           rowCount = 0;
           Company c = new Company();
           
           while (srs.next()) {
               c.setCompany_Name(srs.getString("CompanyName"));
               c.setCompany_Address(srs.getString("CompanyAddress"));

             rowCount++;
         }
        companyList = new LinkedList<Company>();
        companyList.add(c);
        request.setAttribute("tabvalue",companyList);
XML Code:
<c:forEach  var="c2" items="${tabvalue}">
            <TR bgcolor="orange"><TD class = "commonfieldtabledata">

                          <c:out value='${c2.company_Name}'/>
                           </TD>
                <TD class = "commonfieldtabledata">
                    <c:out value='${c2.company_Address}'/>

            </TD>


            </TR>
        </c:forEach >