Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't figure this one out!!! Help please....

Status
Not open for further replies.

timmbo

Programmer
Feb 22, 2001
167
US
Hi All,

I have a jsp page that is not returning a table row after java code runs.
The page drops my table cell after my for loop and I can not figure out why.

HTML code
Code:
<table border align=&quot;center&quot;>
   <%
      if(rptType.equals(&quot;PAWAR&quot;)) {
         for(int i = 0;accounts.size()>1;i++) {
            String acct = (String)accounts.elementAt(i);
            Vector tmpRecs = (Vector)wires.get(acct);
   %>
            <tr>
               <td>Count of my returned rows:  <%= i + 1 %></td>
            </tr>	
   <%
         }
   %>

            <tr>
               <td>Items that are NOT marked with a confirmed status are subject to verification and adjustment.</td>
            </tr>
</table>		
		
   <%
      }
   %>
</BODY>
</HTML>
Once the loop is complete, the HTML will not pick up the next table row &quot;Items that are ...&quot;.
When I do a view source in my browser, it returns:

Code:
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>

<HTML>
<HEAD>
   <title></title>
   <LINK rel=stylesheet type=&quot;text/css&quot; href=&quot;js/wire-style.css&quot; title=&quot;Standard ISC Style&quot;>
</HEAD>
<BODY>
<table border align=&quot;center&quot; width=&quot;100%&quot;>
		
	<tr>							   <td>Count of my returned rows:  1</td>
	</tr>		
	<tr>
	   <td>Count of my returned rows:  2</td>
	</tr>	
	<tr>
	   <td>Count of my returned rows:  3</td>
	</tr>	
	<tr>
	   <td>Count of my returned rows:  4</td>
	</tr>	
	<tr>
	   <td>Count of my returned rows:  5</td>
	</tr>
As you can see, the rest of my HTML is missing.
Can anyone please provide me with some ideas as to why this is happening. I don't see anything wrong with the code -- obviously there is.

Comments most welcome.

TIA
Tim
 
r u sure that your loop is right?.... for(int i = 0;accounts.size()>1;i++) will just keep incrementing i won't it....account.size() will always be > 1.

It probably bombing out when i is greater than the number of accounts. Jeremy Nicholson, Director of a UK-based Java and Data Warehousing consultancy
 
Thanks for the reply Jeremy. My apologies on the delay of getting back to you. I've been out the last couple of days. I think you might be right. I will check into it.

Thanks again,

Tim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top