在jsp页面上添加如下代码: <input type="button" value="保存" οnclick="document.execCommand('SaveAs')"> 在弹出窗口中点击‘保存’按钮即可获得窗口代码。