日期:2014-05-17  浏览次数:20625 次

jsp页面读取html文件
<%
String path="/opt/jboss-eap-5.1/jboss-as/server/default/deploy/ROOT.war/portal/main/index/";  //目录分隔符必须用双斜杠
File file=new File(path,"kjjr.html");
FileReader fr=new FileReader(file);
BufferedReader br=new BufferedReader(fr);
StringBuffer strB=new StringBuffer();
String str=br.readLine();
out.println(str + "123"); //输出读取得的数据
request.setAttribute("str", str);
br.close();
fr.close();
%>