jsp生成html--replace
发表于:2007-07-04来源:作者:点击数:
标签:
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.p
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();
}
}
原文转自:http://www.ltesting.net