站内搜索: 请输入搜索关键词

当前页面: 开发资料首页JSP 专题jsp生成html--readtemplates

jsp生成html--readtemplates

摘要: jsp生成html--readtemplates


ReadTemplates.java

package ball.news;
import java.io.*;
import java.util.*;

public class ReadTemplates
{

private String temp = null;
private Object a = new Object();

public ReadTemplates()
{
}

public String getTlpContent(String s)

{
if(temp == null)
synchronized(a)
{
if(temp == null)
try
{
System.out.println("----------------------------");
temp = a(s);
//System.out.println("test the temp"+temp);
}
catch(Exception e)
{
System.out.println("get tlpconente error"+e.getMessage());
}
}
return temp;
}

private synchronized String a(String s)

{
String s1 = null;
try
{
FileInputStream fileinputstream = new FileInputStream(s);
int i = fileinputstream.available();
byte abyte0[] = new byte[i];
fileinputstream.read(abyte0);
fileinputstream.close();
s1 = new String(abyte0);
}
catch(IOException e)
{
System.out.println("ioexception error"+e.getMessage());
}
return s1;
}

}



↑返回目录
前一篇: hymn新闻系统(后台程序)jsp版
后一篇: jsp生成html--replace