Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

JSP/database help

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

rayhab

Established Member
Impact
1
Hi, im trying to print the columns and rows from a database onto the jsp.
This code does that however, it will print the first column of each row into the last column and shift everything else into the column to the left.
Any ideas on what the problem could be?
<code>

<c:forEach var='item' items='${views2.rows}'>

<sql:query var="t1">
select * from ${item.tableName}
</sql:query>
<tr>
<c:forEach var='columnName' items='${t1.columnNames}'>
<td>
<font><b>--${columnName}--</b></font>
</td>

</c:forEach>
</tr>

<sql:query var="t2">
select * from ${item.tableName}
</sql:query>

<tr>
<c:forEach var='item2' items='${t2.rows}'>
<tr>
<c:forEach var='colval' items='${item2}'>
<td>${colval}</td>
</c:forEach>
</tr>
</c:forEach>
</tr>

.....
</code>
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
I don't use jsp but at a glance :

PHP:
<tr>
<c:forEach var='item2' items='${t2.rows}'>
<tr>
<c:forEach var='colval' items='${item2}'>
<td>${colval}</td>
</c:forEach>
</tr>
</c:forEach>
</tr>
you have a possibility of 2 <tr> i think
like
HTML:
<tr>
<tr>
<td>bla</td>
</tr>
</tr>
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Member card: see how many threads a member started
The member card now shows a Threads number, right after Posts. The member card is the box that opens when you point at a name. Profile...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back