Laura14 de Abril del 2006
PreguntaHola:
Estoy teniendo problemas para sacar los datos de mi dto. El problema es que tengo un interface que es alta.jsp donde añado a mi base de datos los datos de una persona y despues quiero mostrar al usuario los datos que he añadido en un interface llamado detalle paciente. El caso es que lo stoy haciendo todo con struts y en el interface detalle paciente es donde me da el error,(he llegado a la conclusión de esto pq he depurado el código) y ya no se que hacer. El codigo es el siguiente:
-Detalle.jsp
<%@ page contentType="text/html"%>
<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="/c-rt.tld" prefix="c" %>
<%@ taglib uri="struts-html.tld" prefix="html" %>
<%@ taglib uri="struts-logic.tld" prefix="logic" %>
<html:html xhtml="true">
<head><title>Detalle Persona</title></head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Detalle Persona</title>
<style type="text/css">
</style>
<link href="<%=request.getContextPath()%>/css/estilo.css" rel="stylesheet" type="text/css" >
<p align="left"><font color="#000033" face="Georgia, Times New Roman, Times, serif"><em>Centro
Diurno de Salud Mental</em></font></p>
<img src="<%=request.getContextPath()%>/img/z_terra1.gif" alt="image 1" width="60" height="60">
<hr>
</head>
<body>
<jsp:useBean id="dto" scope="session" class="com.centrosalud.model.dto.PersonaDTO"/>
<fieldset>
<legend><h1>Detalle Persona</h1></legend>
<table>
<tr><td>
Identificador: <jsp:getProperty name="dto" property="id" />
</tr> </td>
<tr><td>
Nombre: <jsp:getProperty name="dto" property="nombre" />
</tr></td>
<c:if test="${!empty dto.apellido1}">
<tr><td>
Primer Apellido: <jsp:getProperty name="dto" property="apellido1" />
</tr></td>
</c:if>
<tr><td>
Segundo Apellido: <jsp:getProperty name="dto" property="apellido2" />
</tr></td>
<tr><td>
Direccion: <jsp:getProperty name="dto" property="direccion" />
</tr></td>
<tr><td>
Poblacion:<jsp:getProperty name="dto" property="poblacion" />
</tr></td>
<tr><td>
Provincia: <jsp:getProperty name="dto" property="provincia" />
</tr></td>
<tr><td>
Telefono: <jsp:getProperty name="dto" property="telefono" />
</tr></td>
<tr><td>
Fecha de Nacimiento: <jsp:getProperty name="dto" property="fnacimiento" />
</tr></td>
<tr><td>
Codigo Postal:<jsp:getProperty name="dto" property="codPostal" />
</tr></td>
<tr><td>
DNI:<jsp:getProperty name="dto" property="DNI" />
</tr></td>
<%--
<tr><td>
Alergias:<jsp:getProperty name="dto" property="Alergias" />
</tr></td>
<tr>
<td>
<c:url var="urlEliminar" value="/EliminaPersonaServlet?id=${dto.id}"/>
<a href="${urlEliminar}">Eliminar</a>
</td>
<td>
<c:url var="urlModificar" value="/VisualizarDatModificarServlet?id=${dto.id}"/>
<a href="${urlModificar}">Modificar</a>
</td>
</tr>
<c:if test="${!empty requestScope.mensaje}">
<tr><td style="color:blue"><c:out value="${mensaje}"/></td></tr>
</c:if>
<c:url var="previous" value="/">
</c:url>
--%>
<a href='<c:out value= "${previous}"/>'>Volver atras</a>
</table>
</body>
</html:html>
Por favor si me podeis ayudar me hariais un gran favor, no se si estoy hacindo bien la pag jsp. Saludos y muchas gracias por anticipado.
Estoy teniendo problemas para sacar los datos de mi dto. El problema es que tengo un interface que es alta.jsp donde añado a mi base de datos los datos de una persona y despues quiero mostrar al usuario los datos que he añadido en un interface llamado detalle paciente. El caso es que lo stoy haciendo todo con struts y en el interface detalle paciente es donde me da el error,(he llegado a la conclusión de esto pq he depurado el código) y ya no se que hacer. El codigo es el siguiente:
-Detalle.jsp
<%@ page contentType="text/html"%>
<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="/c-rt.tld" prefix="c" %>
<%@ taglib uri="struts-html.tld" prefix="html" %>
<%@ taglib uri="struts-logic.tld" prefix="logic" %>
<html:html xhtml="true">
<head><title>Detalle Persona</title></head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Detalle Persona</title>
<style type="text/css">
</style>
<link href="<%=request.getContextPath()%>/css/estilo.css" rel="stylesheet" type="text/css" >
<p align="left"><font color="#000033" face="Georgia, Times New Roman, Times, serif"><em>Centro
Diurno de Salud Mental</em></font></p>
<img src="<%=request.getContextPath()%>/img/z_terra1.gif" alt="image 1" width="60" height="60">
<hr>
</head>
<body>
<jsp:useBean id="dto" scope="session" class="com.centrosalud.model.dto.PersonaDTO"/>
<fieldset>
<legend><h1>Detalle Persona</h1></legend>
<table>
<tr><td>
Identificador: <jsp:getProperty name="dto" property="id" />
</tr> </td>
<tr><td>
Nombre: <jsp:getProperty name="dto" property="nombre" />
</tr></td>
<c:if test="${!empty dto.apellido1}">
<tr><td>
Primer Apellido: <jsp:getProperty name="dto" property="apellido1" />
</tr></td>
</c:if>
<tr><td>
Segundo Apellido: <jsp:getProperty name="dto" property="apellido2" />
</tr></td>
<tr><td>
Direccion: <jsp:getProperty name="dto" property="direccion" />
</tr></td>
<tr><td>
Poblacion:<jsp:getProperty name="dto" property="poblacion" />
</tr></td>
<tr><td>
Provincia: <jsp:getProperty name="dto" property="provincia" />
</tr></td>
<tr><td>
Telefono: <jsp:getProperty name="dto" property="telefono" />
</tr></td>
<tr><td>
Fecha de Nacimiento: <jsp:getProperty name="dto" property="fnacimiento" />
</tr></td>
<tr><td>
Codigo Postal:<jsp:getProperty name="dto" property="codPostal" />
</tr></td>
<tr><td>
DNI:<jsp:getProperty name="dto" property="DNI" />
</tr></td>
<%--
<tr><td>
Alergias:<jsp:getProperty name="dto" property="Alergias" />
</tr></td>
<tr>
<td>
<c:url var="urlEliminar" value="/EliminaPersonaServlet?id=${dto.id}"/>
<a href="${urlEliminar}">Eliminar</a>
</td>
<td>
<c:url var="urlModificar" value="/VisualizarDatModificarServlet?id=${dto.id}"/>
<a href="${urlModificar}">Modificar</a>
</td>
</tr>
<c:if test="${!empty requestScope.mensaje}">
<tr><td style="color:blue"><c:out value="${mensaje}"/></td></tr>
</c:if>
<c:url var="previous" value="/">
</c:url>
--%>
<a href='<c:out value= "${previous}"/>'>Volver atras</a>
</table>
</body>
</html:html>
Por favor si me podeis ayudar me hariais un gran favor, no se si estoy hacindo bien la pag jsp. Saludos y muchas gracias por anticipado.
