Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > I want to populate an HTML table java spring

Thread Tools

I want to populate an HTML table java spring

rajib27 rajib27 is offline
Junior Member
Join Date: Mar 2010
Posts: 1
I am using java springs and jstl.I want to populate an HTML table.
I am using the following code.It works fine but we have to create object
each time for each row.please help How I can populate the table dynamically.

         List<Company> companyList;
        JdbcTemplate tpl = new JdbcTemplate(ds());
        srs = tpl.queryForRowSet("select CompanyName,CompanyAddress from company");
           rowCount = 0;
           Company c = new Company();
           while ( {
        companyList = new LinkedList<Company>();

HTML Code:
<TABLE class="commonfieldtable" colspan="3%" align="center" width="500" bgcolor="Brown">
            <TR><TH class="commonfieldtable">CompanyName</TH><TH class="commonfieldtable">CompanyAddress</TH></TR>
            <c:forEach  var="c2" items="${tabvalue}">
            <TR bgcolor="orange"><TD class = "commonfieldtabledata">
                          <c:out value='${c2.company_Name}'/>
                <TD class = "commonfieldtabledata">
                          <c:out value='${c2.company_Address}'/>
        </c:forEach >
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Spring Python 0.8.0 has been released/Spring Python goes green Goldfish Python 1 11-06-2008 06:12 PM
differences between Spring WebFlow,Spring MVC,and String Portlet MVC? rmn190 Java 2 01-10-2008 02:27 AM
Populate oracle table with values in CSV using Java csv java Java 6 10-15-2006 05:41 AM
How to populate HTML table from local text file. alex Javascript 10 03-31-2005 10:28 PM
Populate a popup window with clickable records from an Access DB and upon clicking, populate a selectbox on the original webpage with the clicked record Enjoy Life ASP General 2 02-23-2005 10:48 PM