jsp生成html--replace
package ball.news;
import java.io.*;
import news.readtemplates;
public class replaceall
{
private static object a = new object();
public replaceall()
{
}
public string replace(string content,string flag,string temp)
{
string str = null;
try
{
//system.out.println("before-----"+content);
string s1 = content;
str = s1.replaceall(flag,temp);
// system.out.println("replace after-----"+str);
}
catch(exception e)
{
system.out.println("replace all error:"+e.getmessage());
}
return str;
}
private static void a(string s)
{
file file = new file(s);
if(!file.exists())
file.mkdirs();
}
}
下一篇: 高效简单的jsp分页