2011-12-01 97 views
0

我必须从数据库(Oracle 10g)中获取图像并显示它们,但我无法显示图像。我的代码是:html图像不显示

<% 
    String[] salespersons; 
    String[] name; 
    String[] photoid; 

    String tempid="", tempname="", tempphoto=""; 
    ResultSet rs = statement.executeQuery("select * from Employees where ManagerID=" + managerid); 
    while(rs.next()) { 
     tempid += rs.getInt("id") + ";"; 
     tempname += rs.getString("firstname") + ";"; 
     tempphoto += rs.getString("photoid") + ";"; 
    } 

    salespersons = tempid.split(";"); 
    name = tempname.split(";"); 
    photoid = tempphoto.split(";"); 
%> 

<input type="button" value="CLOSE" onclick="window.close()" /> 
<table border="5" cellpadding="2" align="center"> 
<% 
    for(int ite=0; ite < name.length; ite++) { 
%> 
     <tr> 
     <td><a href="" onclick=""><%=salespersons[ite]%></a></td> 
     <td><%=name[ite]%></td>    
     <td><img src="<%=photoid[ite]%>" alt="image not available"/></td> 
     <td><a href="<%=photoid[ite]%>"></a></td> 
<% 
    } 
%> 
    </tr> 
</table> 
+0

是否正确显示(2个链接和其他要素包含在<%= name [ite]%>')中的值? –

+0

你....没有问题与其他两个元素 – user988993

+0

你可以发布HTML输出?只是桌子应该做的。 –

回答

0

图像具有比只图像不显示第一打印图像的路径,然后把它作为一个图片网址错误的道路......

+0

我做了同样的..甚至包括ALT标签选项,但是是不显示替代文字也 – user988993