jsp生成html--writehtml
发表于:2007-07-04来源:作者:点击数:
标签:
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[] =
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://www.ltesting.net