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