首页 新闻 会员 周边

play框架 快捷方式如何实现

0
悬赏园豆:20 [待解决问题]

点击快捷方式,跳出下载页面的功能用play怎么实现阿?我用struts2试了网上的例子,倒是可以,不过用play该怎么写阿?有人知道吗?求解决!!!

问题补充:

http://blog.csdn.net/ft305977550/article/details/11602881

这是jsp生成桌面快捷方式的网址,用在play上该如何使用呢?

monkey456的主页 monkey456 | 初学一级 | 园豆:107
提问于:2015-12-26 20:10
< >
分享
所有回答(2)
0

你去开源中国网看下,里面有!

搁忆 | 园豆:612 (小虾三级) | 2015-12-28 14:04

好的,谢谢

支持(0) 反对(0) monkey456 | 园豆:107 (初学一级) | 2015-12-28 14:05

@monkey456: 不用

支持(0) 反对(0) 搁忆 | 园豆:612 (小虾三级) | 2015-12-28 14:12
0

用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();     
        }  

monkey456 | 园豆:107 (初学一级) | 2015-12-28 14:08
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册