excel 템플릿 다운로드

2325 단어 Excel
 // 
      /*   */
        private String fileName;
        private InputStream inputStream;
      /** *    upload  *   * url:upload  * <a href="$!link.contextPath/common/download_downloadAnnex.htm?url=userinfo/$!{userInfo.userId}/archives/$!{object.archivesPic}"> * @return */
        public String downloadAnnex(){
            try {
                String msg="";
                String url = request.getParameter("url");
                if(StringUtils.isNotEmpty(url)){
                    String filePath = request.getSession().getServletContext().getRealPath(File.separator) + "module/"+url;
                    File file = new File(filePath);
                    if(file.exists() && !file.isDirectory()){
                        fileName = url.substring(url.lastIndexOf("/")+1);
                        inputStream = ServletActionContext.getServletContext().getResourceAsStream(File.separator + "module" + File.separator + url);
                    }else{
                        msg = " ";// 
                        return "tip";
                    }
                }
            } catch (Exception e) {
                request.setAttribute("msg"," , 。");
                e.printStackTrace();
            }
            return "download";
        }

좋은 웹페이지 즐겨찾기