JSP generates HTML - ReadTemplates

xiaoxiao2021-03-06  67

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";} 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;}

}

转载请注明原文地址:https://www.9cbs.com/read-86627.html

New Post(0)