标题:struts文件下载问题
取消只看楼主
fujinliang
Rank: 1
等 级:新手上路
帖 子:25
专家分:0
注 册:2007-3-30
结帖率:0
 问题点数:0 回复次数:0 
struts文件下载问题
ACTION中:
public InputStream getTargetFile() throws Exception{
        return ServletActionContext.getServletContext().getResourceAsStream("upload\\"+getDownloadFileName());
    }
    public String getDownloadFileName(){
        
         String downFileName=ServletActionContext.getRequest().getParameter("name");
        try{
            downFileName=new String(downFileName.getBytes(),"ISO8859-1");
        }catch(UnsupportedEncodingException e){
            e.printStackTrace();
        }
        return downFileName;
    }
怎么name得到的参数是中文就有问题呢,,,拔出异常
搜索更多相关主题的帖子: struts 文件 
2008-12-01 22:42



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-247264-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 2.461533 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved