Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/03/2010, 15:19
ferran69
 
Fecha de Ingreso: marzo-2010
Mensajes: 2
Antigüedad: 14 años, 1 mes
Puntos: 0
Exclamación JPS y Bucles for

Buenas,

Estoy haciendo una practica de un tweeter para la universidad y no consigo hacer que me funcione el bucle.
El codigo jsp es:

Código HTML:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Mur</title>
</head>
<body>

<CENTER>
	<H1>Tweets</H1>
	<br>
	<TABLE width=80% cellspacing=3 cellpadding=2 BORDER=0>
		<%= int cosa = Integer.parseInt(session.getAttribute("ntweets")) %>
		<% for(int i = 0; i < cosa; i++){ %>
			<tr>
				<td>
					<TABLE width=100% cellspacing=3 cellpadding=2 BORDER=0>
						<TR>
							<TD rowspan="3" width=20% align="center"><img width="60%" src="fotos/anonimouse.gif"></TD>
							<TD width=80% align="left"><%= session.getAttribute("user"+i) %></TD>
						</TR>
						<tr>
							<TD width=80% align="left"><%= session.getAttribute("tweet"+i) %></TD>
						</tr>
						<tr>
							<TD width=80% align="left">Eliminar / modificar</TD>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td>
								<%= int cosa2 = Integer.parseInt(session.getAttribute("nsubtweets"+i)) %>
								<% for(int j = 0; j < cosa2; j++){ %>
									<table width=100% cellspacing=3 cellpadding=2 BORDER=0>
									
										<TR>
											<TD rowspan="3" width=15% align="center"><img width="60%" src="fotos/anonimouse.gif"></TD>
											<TD width=85% align="left"><%= session.getAttribute("user"+i+j) %></TD>
										</TR>
										<tr>
											<TD width=85% align="left"><%= session.getAttribute("subtweet"+i+j) %></TD>
										</tr>
										<tr>
											<TD width=85% align="left">Eliminar / modificar</TD>
										</tr>
										<tr>
									
									</table>
								<% } %>
							</td>
						</tr>
						<tr>
							<td colspan="2">&nbsp;</td>
						</tr>
					</TABLE>
				</td>
			</tr>
		<% } %>
			
	</TABLE>
	
</CENTER>

</body>
</html> 
Según eclipse tengo un error en el token del final, el que cierra el primer bucle for.
Los <%= codigo %> son así por los parámetros y los demás sin el igual es porque es código a secas, por lo que he entendido. No hay manera, lo he mirado en millones de sitios y nada.
Por adelantado, muchísimas gracias por la ayuda.