raf4ever
Não tinha como delegar pra um método ler essa foto e apenas jogar os bytes no response?
jMarcel
Pesquisei e consegui printar a imagem no browser, mas agor não estou conseguindo emoldura-la pelo .css. Você sabe como fazer ? Veja abaixo o código.
jMarcel
Alguém saberia como posso emoldurar a imagem no .css, de acordo com a imagem printada pelo código abaixo:
jsp:
<%
Connection con = FactoryConnection_SQL_SERVER.getConnection("Organograma");
Statement stSuper = con.createStatement();
Statement stSetor = con.createStatement();
Blob image = null;
byte[] imgData = null;
ResultSet rsSuper = stSuper.executeQuery("Select * From funChart where setor = 'mySetor'");
if (rsSuper.next()) {
image = rsSuper.getBlob(12);
imgData = image.getBytes(1, (int) image.length());
response.setContentType("image/gif");
OutputStream o = response.getOutputStream();
o.write(imgData);
o.flush();
o.close();
--[...]
<table style="margin: 0px; margin-top: 15px;">
<tr>
<td id="foto">
<img title="<%=rsSuper.getString("Nome").trim()%>" src="<%= o.wite(imageData); %>" />
</td>
</td>
<td id="dados">
<h3><%=rsSuper.getString("Nome")%></h3>
<p><%=rsSuper.getString("Cargo")%></p>
<p>Matrícula:<br/><%=rsSuper.getString("Chave")%></p>
<p>Telefone:<br/><%=rsSuper.getString("Fone")%></p>
<p>E-Mail:<br/><%=rsSuper.getString("Email")%></p>
</td>
</table>
.css:
#foto
{
padding: 0px;
vertical-align: middle;
text-align: center;
width: 170px;
height: 220px;
}
A imagem é exibida, mas está ocupando a página toda.