这次由于公司的网站需要每天更新一个专题活动,破不得已,只好写一个动态生成页。以下做个记录,以备日后参考:
JAVA页面
* 生成HTML页面
*/
public void hotread(){
String path = ServletActionContext.getServletContext().getRealPath("/");
String realPath = path+fileName+".html";
File file=new File(realPath);
try{
byte tag_bytes[] = content2.getBytes();
FileOutputStream out = new FileOutputStream(file);
out.write(tag_bytes);
out.close();
}catch(Exception e){
e.printStackTrace();
}
}
















