利用ArrayList在jsp文件中引用图片老是出错,大虾救命!!

xuycan
06-08-01 2 154



<tr>
<%
ArrayList wxlist=(ArrayList)session.getAttribut("wxlist");
Iterator wxit=wxlist.iterator();
ProductBean wx=null;
while(wxit.hasNext())
{
wx=(ProductBean)wxit.next();
out.println(
"<td align=center valign=top width=3%
height=20%></td>
");
out.print(
"<td align=center valign=top width=22% height=50% >");

out.print(
"<a href="+"TopServlet?id="+wx.getPid()+">");
//下面这句老是出错(我用的是eclipse工具,图片在shoppingsystem应用下的WebRoot\picture\wenxue里,但我不会相对引用?)
out.print(
"<img src=d:\java software\eclispe\workspace\shoppingsystem\WebRoot\picture\wenxue\"+wx.getPicture()+".jsp"+">");
%>
code]
请大虾们帮

banq
2006-08-03 15:35

需要了解的是Jsp是什么样技术。是服务器技术还是客户端技术。

qqq1981
2006-08-05 16:55

<tr>
<%
ArrayList wxlist = (Arraylist)session.getAttribute("wxlist");
for(int i=0;i<wxlist.size;i++)
{
ProductBean wx = (ProductBean)wxlist.get(i);
%>
<td align=center valign=top width=3% height=20%></td>
<td align=center valign=top><a href ="topserver?id=<%=wx.getPid()%"><img src=d:\java software\eclispe\workspace\shoppingsystem\WebRoot\picture\wenxue\\\ + wx.getPicture() alt="图片"></td>
<%
}
%>