想用JSP循环显示图片 图片路径为:E:\Picture\WebImg\Hot\Show\1.jpg
想循环输出的路径为:..\Show\1.jpg 代码片段如下,希望各位大侠帮帮忙!
<%
request.setCharacterEncoding("GBK");
GamesDao ud = new GamesDao();
List<GamesInfo> list = ud.showGames();
for(int i=4;i<8;i++)
{
%>
<a href="<%=request.getContextPath()% >/ZYJSP/GamesShow.jsp?Id=<%=list.get(i).getGamesID() %>" target="_blank">
<%
String gamesPic = gamesinfo.getGamesPic();
gamesPic = gamesPic.replaceAll("E:\Picture\WebImg\Hot", "..");
%> <%-- 就是这里转换出现问题 --%>
<img src="<%= list.get(i).gamesPic %>"/>
<%
}
%>
请大虾帮帮忙 问题还是没能解决!
顺便问一下怎样在jsp利用 embed 播放背景音乐
代码如下:
<embed src="../ZYDownLoad/DownMusic/爱我别走.mp3" width="340" height="80" loop="true" autostart="true"></embed>
在html中可以播放 但在JSP中就只有显示没有播放