日期:2014-05-18  浏览次数:20681 次

怎样写个可以提供可以下载的页面
我写了一个页面 用JSP写的 现在就是有个问题,在页面中需要看一个3D文件,我在JS中写了一个方法,判断如果本机上装得有这种播放器的就会打开,没有的则跳到一个可供下载的页面,这个可供下载的页面该如何写?

------解决方案--------------------
没太搞明白你说的下载是什么意思!
这个是我的下载代码!
XML code
<logic:notEmpty name="accessories">
              <table width="50%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000000">
          <tr>
            <td bgcolor="#FFFFFF">
              <table width="50%" border="0" align="left" cellspacing="0"  id=tabfj name=tabfj>
                <tr>
                  <td width="16%">&nbsp;</td>
                  <td ><b>附件</b></td>
                </tr>

                    <logic:iterate id="acc" name="accessories">
                        <tr id="tr">
                  <td align="center" width="100">文件名称
                      </td>
                  <td align="center">
                    <a href="<%=webmodule %><bean:write name="acc" property="relativePath"/><bean:write name="acc" property="name"/>">
                <bean:write name="acc" property="name"/></a>
              </td>
                    </tr>
                    </logic:iterate>
              </table>
            </td>
          </tr>
        </table>
  </logic:notEmpty>

------解决方案--------------------
可以用servlet实现啊
将Content-Type设定成浏览器无法直接打开的类型