matheusPJ 14 de mar. de 2005
tu esta usando uma tag de scriptlet… ta errado, faça assim:
<%= temp.getString("imagem") %>
observe o “=” no inicio da tag… e não coloque “;” no final!!
fer_scaliaPJ 14 de mar. de 2005
matheus, nao funcionou como vc falou, a minha classe ficou assim:
& lt ; %@ page contentType="text/html" language="java" import="java.sql.*"%>
& lt ; !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" & gt ;
& lt ; jsp & #58 ; useBean id="con" class="conexao.Conexao"/> ;
& lt ; html & gt ;
& lt ; head & gt ;
& lt ; title & gt ; Untitled Document< ; / title & gt ;
& lt ; meta http-equiv="Content-Type" content="text/html ; charset = iso - 8859 - 1 ">
</head>
<body>
<form name=" form1 " method=" post " action=" pessoa . jsp ">
<p><strong>Tabela Pessoa </strong></p>
<table border=1 cellspacing=0 cellpadding=0 >
<tr>
<td width=200><strong>
Nome
</strong></td>
<td width=50><strong>
Idade
</strong></td>
<td width=30><strong>
Sexo
</strong></td>
</tr>
<%
try {
con.setConsulta();
ResultSet temp = con.getResultado();
while (temp.next()){
%>
<tr>
<td width=200>
<%out.print(temp.getString(" nome "));%>
</td>
<td width=50>
<%out.print(temp.getString(" idade "));%>
</td>
<td width=30>
<%out.print(temp.getString(" imagem "));%>
</td>
<td>
<IMG src=" img /& lt ; %= temp.getString("imagem") %>.gif" width="115" height="115">
& lt ; / td & gt ;
& lt ; %}
& #125 ; catch & #40 ; Exception e) ; & #123 ;
e . printStackTrace & #40 ; & #41 ;;
& #125 ;
%>
& lt ; / table & gt ;
& lt ; p & gt ;
& lt ; input type = "submit" name = "Submit" value = "voltar" & gt ;
& lt ; / p & gt ;
& lt ; / form & gt ;
& lt ; / body & gt ;
& lt ; / html & gt ;
matheusPJ 15 de mar. de 2005
nao funcionou? e qual o erro ? oq ele retorna disso ai?
temp.getString("imagem");
fer_scaliaPJ 15 de mar. de 2005
Matheus, ele nao retorna erro, apenas nao aparece nenhuma imagem. Sendo que se eu mandar exibir o codigo da pagina html ele fica com o endereço certinho “img/01.gif”.
A pasta img esta no diretorio raiz… isso nao tem nada a ver nao ne…
eu nao estou conseguindo achar o erro…
se puder ajudar, serei grato.