jsp生成html--writehtml

类别:Java 点击:0 评论:0 推荐:


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

本文地址:http://com.8s8s.com/it/it13036.htm