网站首页  汉语字词  英语词汇  考试资料  写作素材

请输入您要查询的考试资料:

 

标签的border 样式在浏览器中显示不出来的解决方法
  • 剖析标注HTML元素时class比id所具有的优势
  • Table显示你要显示的边框代码
  • 点击按钮文字变成input框,点击保存变成文字的实现代码
  • 关于table表格中的内容溢出布局方法
  • html的footer置于页面最底部的简单实现方法
  • 移动端网页大小自适应的实现方法
  • 如何实现textarea中获取动态剩余字数的方法
  • PHP-HTMLhtml重要知识点笔记(必看)
  • 标题 JSP点击链接后下载文件功能
    分类 范文、应用文-IT技术专栏-网页制作
    内容
        /** *//**
        * 实现文件另存功能
        *
        * @param text
        * 文件内容
        * @param fileName
        * 文件名称
        * @return
        */
        protected String renderFile(String text, String fileName)
        throws IOException
        {
        response.addHeader("Content-Disposition", "attachment; filename="
        + fileName);
        response.setContentType("application/octet-stream");
        response.setCharacterEncoding("GB2312");
        response.getWriter().write(text);
        response.flushBuffer();
        response.getWriter().close();
        return null;
        }
        下载的action:
        /** *//**
        * 提供下载的方法
        * @return
        */
        public String down()
        {
        String dir = getFullPath() + "https://upload.ynpxrz.com/upload/file/";
        try
        {
        if (!FileUtils.exists(dir))
        {
        new File(dir).mkdirs();
        }
        Random r = new Random(System.currentTimeMillis());
        Integer randomInt = r.nextInt();
        this.renderFile("test content:" + randomInt,randomInt + ".txt");
        }
        catch (IOException e)
        {
        e.printStackTrace();
        this.renderText(e.getMessage());
        }
        return null;
        }
    随便看

     

    客官网考试资料包含高考、自考、专升本考试、人事考试、公务员考试、大学生村官考试、特岗教师招聘考试、事业单位招聘考试、企业人才招聘、银行招聘、教师招聘、农村信用社招聘、各类资格证书考试等各类考试资料。

     

    Copyright © 2002-2024 cumcu.com All Rights Reserved
    更新时间:2026/7/5 8:30:26