当前位置:编程学习 > JS >>

jsp生成html--writehtml


WriteHtml.java

package ball.news;

import java.io.*;

public class WriteHtml
{

    public WriteHtml()
    {
    }

    public static void save(String s, String s1, String s2)
       
    {
        try
        {
            a(s1);
            FileOutputStream fileoutputstream = new FileOutputStream(s1 + s2);
            byte abyte0[] = s.getBytes();
            fileoutputstream.write(abyte0);
            fileoutputstream.close();
        }
        catch(IOException e)
        {
         System.out.println("write html error"+e.getMessage());
        }
    }

    private static void a(String s)
    {
       try
       {
        File file = new File(s);
        if(!file.exists())
            file.mkdirs();
       }
       catch (Exception e)
       {
        System.out.println("mkdirs error!"+e.getMessage());
       }
    }
}

补充:Web开发 , Jsp ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,