Foros del Web » Programación para mayores de 30 ;) » Java »

Ayuda con JSP/JAVA

Estas en el tema de Ayuda con JSP/JAVA en el foro de Java en Foros del Web. Hola colegas, tengo una duda sobre una pagina web ke estoy haciendo en java, jsp y html, la cuestion es ke acabo de realizar una ...
  #1 (permalink)  
Antiguo 27/05/2007, 04:44
 
Fecha de Ingreso: mayo-2006
Mensajes: 39
Antigüedad: 18 años
Puntos: 0
Ayuda con JSP/JAVA

Hola colegas, tengo una duda sobre una pagina web ke estoy haciendo en java, jsp y html, la cuestion es ke acabo de realizar una pagina y me da el siguiente error:

Código:
No se puede compilar la clase para JSP: Ha tenido lugar un error en la línea: 161 en el archivo jsp: /usuari.jsp Syntax error, insert "Finally" to complete TryStatement 158: 159: 160: 161: <% }//isAutenticat %> 162: <%@ include file="includes/bottom.jsp" %>
Espero ke alguien me pueda echar una cable.

Un saludo.
  #2 (permalink)  
Antiguo 27/05/2007, 06:03
Avatar de cris_maco  
Fecha de Ingreso: abril-2007
Ubicación: Salamanca
Mensajes: 254
Antigüedad: 17 años
Puntos: 0
Re: Ayuda con JSP/JAVA

pon un poquito de codigo, porque en la linea 161 no se ve nada raro
  #3 (permalink)  
Antiguo 27/05/2007, 07:58
 
Fecha de Ingreso: mayo-2006
Mensajes: 39
Antigüedad: 18 años
Puntos: 0
Re: Ayuda con JSP/JAVA

Aki teneis el fichero entero:

Código:
<%@page import="java.util.*,etse.sob.bean.*,etse.sob.entitats.usuari.*"%>
<%@ include file="includes/top.jsp" %>
<% 
if (autenticacio.isAutenticat()) { 
  if(request.getAttribute("opcio")==null){ 
	request.setAttribute("opcio", 1);
	response.sendRedirect("usuari.do?opcio=1");
	}%>
<%
	if(request.getAttribute("opcio").equals("0")){
		%><div align="center"><%
	}else{
		%><div align="left"><%
	}
%>	
<table border="1">
	<tr>
		<th><a href="usuari.do?opcio=1">Llistar Usuaris</a></th>
	</tr>
	<tr>
		<th><a href="usuari.do?opcio=2">Nou Usuari</a></th>
	</tr>
	<tr>
		<th><a href="usuari.do?opcio=3">Modificar Usuari</a></th>
	</tr>
</table>
</div>

<center>
<% if(request.getAttribute("opcio").equals("1")){ %>	

<h1><font face='Trebuchet MS' color='#000066'>Usuaris del sistema:</font></h1>
<br>
	<table border="1">
		<tr>
			<th align="center" width='100'>Login</th>
			<th align="center" width='100'>Rang</th>
		</tr>
<%
Collection c = (Collection)request.getAttribute("coleccio");
Iterator i = c.iterator();
while (i.hasNext()) {
	UsuariVO vo = (UsuariVO)i.next();
%>
		<tr>
			<td align="center"><%=vo.getLogin() %></td>
			<td align="center"><% if(vo.getAdmin() == 1){
				%><font color='#000066'>Administrador</font><%
					}else{
				%><font color='#FF0000'>Usuari</font><%
					}
				%>
				</td>
		</tr>
<% } %>
	</table>
<% }//fi if opcio=1 %>
</center>

<% if(request.getAttribute("opcio").equals("2")){ %>
<br><br>
<form method="post" action="usuari.do?opcio=1">
<center>
	<h1><font face='Trebuchet MS' color='#000066'>Nou Usuari:</font></h1>
	<table border="1">
		<tr>
			<th align='left'><font face='Trebuchet MS' color='#000066' size='2'><b>Login:</b></font></th>
			<td bgcolor="#ffffee"><input type="text" name="login" size="30"></td>
		</tr>
		<tr>
			<th align='left'><font face='Trebuchet MS' color='#000066' size='2'><b>Password:</b></font></th>
			<td bgcolor="#ffffee"><input type="password" name="clau1" size="30"></td>
		</tr>
		<tr>
			<th align='left'><font face='Trebuchet MS' color='#000066' size='2'><b>Torna a introdui el Password:</b></font></th>
			<td bgcolor="#ffffee"><input type="password" name="clau2" size="30"></td>
		</tr>
		<tr>
			<th align='left'><font face='Trebuchet MS' color='#000066' size='2'><b>Ser&agrave; administrador?:</b></font></th>
			<td bgcolor="#ffffee"><select name="admin">
					<option value=1>Administrador</option>
					<option value=0>Usuari</option>
				</select>
		</tr>
		<tr>
			<th><input type="submit" name="insertar" value="[ Insertar ]"></th>
			<th><input type="submit" name="cancelar" value="[ Cancel·lar ]"></th>
		</tr>
	</table>
<jsp:useBean id="error" scope="request" class="etse.sob.controller.ErrorBean" />
<font color="red"><h2><jsp:getProperty name="error" property="message"/></h2></font>
</center>
</form>	
<% }//fi if opcio=2 %>

<center>
<% if(request.getAttribute("opcio").equals("3")){ %>
		if(request.getAttribute("modi")==null){
<h1><font face='Trebuchet MS' color='#000066'>Usuaris del sistema:</font></h1>
<br>
	<table border="1">
		<tr>
			<th align="center" width='100'>Login</th>
			<th align="center" width='100'>Rang</th>
		</tr>
<%
Collection c = (Collection)request.getAttribute("coleccio");
Iterator i = c.iterator();
while (i.hasNext()) {
	UsuariVO vo = (UsuariVO)i.next();
%>
		<tr>
			<td align="center"><a href="usuari.do?modificar=<%=vo.getLogin() %>"><%=vo.getLogin() %></a></td>
			<td align="center"><% if(vo.getAdmin() == 1){
				%><font color='#000066'>Administrador</font><%
					}else{
				%><font color='#FF0000'>Usuari</font><%
					}
				%>
				</td>
		</tr>
<% }//fi while %>
	</table>
		<% }else{
			UsuariVO vo = (UsuariVO)request.getAttribute("modi");
			%>
			<form method="post" action="usuari.do?opcio=1">
			<table border="1">
				<tr>
					<th align='left'><font face='Trebuchet MS' color='#000066' size='2'><b>Login:</b></font></th>
					<td bgcolor="#ffffee"><input type="text" name="loginM" size="30" value="<%=vo.getLogin() %>"></td>
				</tr>
				<tr>
					<th align='left'><font face='Trebuchet MS' color='#000066' size='2'><b>Password:</b></font></th>
					<td bgcolor="#ffffee"><input type="password" name="clau1M" size="30"></td>
				</tr>
				<tr>
					<th align='left'><font face='Trebuchet MS' color='#000066' size='2'><b>Torna a introdui el Password:</b></font></th>
					<td bgcolor="#ffffee"><input type="password" name="clau2M" size="30"></td>
				</tr>
				<tr>
					<th align='left'><font face='Trebuchet MS' color='#000066' size='2'><b>Ser&agrave; administrador?:</b></font></th>
					<td bgcolor="#ffffee"><select name="adminM">
						<%if(vo.getAdmin()==1){ %>
							<option value=1 selected>Administrador</option>
							<option value=0>Usuari</option>
						<% }else{ %>
							<option value=1>Administrador</option>
							<option value=0 selected>Usuari</option>
						<% } %>		
						</select>
				</tr>
				<tr>
					<th><input type="submit" name="modi_dada" value="[ Modificar ]"></th>
					<th><input type="submit" name="cancel_modi" value="[ Cancel·lar ]"></th>
				</tr>
			</table>
			</form>
	<% }//fi if modi %>
<% }//fi if opcio %>
</center>

<% }//isAutenticat %>
<%@ include file="includes/bottom.jsp" %>
Un saludo.
  #4 (permalink)  
Antiguo 27/05/2007, 09:21
 
Fecha de Ingreso: mayo-2006
Mensajes: 39
Antigüedad: 18 años
Puntos: 0
Re: Ayuda con JSP/JAVA

Ya lo tngo solucionado, gracias igualmente.!

Un saludo.
  #5 (permalink)  
Antiguo 25/09/2008, 03:34
 
Fecha de Ingreso: septiembre-2008
Mensajes: 1
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: Ayuda con JSP/JAVA

Hola luiski,

Me está ocurriendo el mismo problema que tu tubiste en su momento y me gustaría saber como lo solucionaste.

Muchas gracias.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 06:27.