我要在JSP网页上实现音乐试听,音乐地址保存在数据库中的,主要代码如下:
<%@page contentType="text/html;charset=GB2312"%>
<%
String id=request.getParameter("gq_id").trim();
int hw_id=Cint(id);
sql="select * from gq where gq_id="+gq_id;
rs=mdb.executeQuery(sql);
if(rs.next())
{ %>
<EMBED style="FILTER: xray()" src=" <%=rs.getString("gq_lujing")%>" width=300 height=50 type=audio/mpeg loop="-1" autostart="true" volume="0" ShowStatusBar="1"> <%}%> 数据库中的地址取出来没有问题,现在的主要问题集中在EMBED控件不能用,总说找不到给音乐文件.我把SRC后的路径用直接的路径表示出来,比如:SRC="MUSIC/1.mp3",仍然不能用,请高手指点一下.谢谢先!
<%@page contentType="text/html;charset=GB2312"%>
<%
String id=request.getParameter("gq_id").trim();
int hw_id=Cint(id);
sql="select * from gq where gq_id="+gq_id;
rs=mdb.executeQuery(sql);
if(rs.next())
{ %>
<EMBED style="FILTER: xray()" src=" <%=rs.getString("gq_lujing")%>" width=300 height=50 type=audio/mpeg loop="-1" autostart="true" volume="0" ShowStatusBar="1"> <%}%> 数据库中的地址取出来没有问题,现在的主要问题集中在EMBED控件不能用,总说找不到给音乐文件.我把SRC后的路径用直接的路径表示出来,比如:SRC="MUSIC/1.mp3",仍然不能用,请高手指点一下.谢谢先!
id=MediaPlayer type=application/x-oleobject width=210 height=340 standby="Loading Microsoft Windows Media Player components..." VIEWASTEXT align=MIDDLE>试试,参数选只放音乐的就好了
src="../<%=rs.getString("gq_lujing")%>""