jsp生成html--writehtml

80酷酷网    80kuku.com

  js|生成htmlWriteHtml.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());
}
}
}




分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: