点击快捷方式,跳出下载页面的功能用play怎么实现阿?我用struts2试了网上的例子,倒是可以,不过用play该怎么写阿?有人知道吗?求解决!!!
http://blog.csdn.net/ft305977550/article/details/11602881
这是jsp生成桌面快捷方式的网址,用在play上该如何使用呢?
你去开源中国网看下,里面有!
好的,谢谢
@monkey456: 不用
用renderBinary返回输入流就可以了
String templateContent = "[InternetShortcut]" + "\n" + "URL= http://www.baidu.com";
String realfilename = "百度" + ".url";
FileSystemView fsv = FileSystemView.getFileSystemView();
String upurl = fsv.getHomeDirectory().toString();
System.out.println(upurl);
String filename = upurl + "/" + realfilename;
File myfile = new File(filename);
if(!myfile.exists()){
FileOutputStream fileoutputstream = new FileOutputStream(filename);//建立文件输出流
byte tag_bytes[] = templateContent.getBytes();
fileoutputstream.write(tag_bytes);
fileoutputstream.close();
}
try {
File file = new File(upurl, realfilename);
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
byte[] buffer = new byte[111000];
renderBinary(bis,realfilename);
bis.close();
} catch (Exception e) {
e.printStackTrace();
}