日期:2014-05-18  浏览次数:20640 次

这么把jsp页面提交的content生成一个html文件
<input   type=text   name=file>
<input   type=text   name=content>

这么把content内容生成file.html文件??

------解决方案--------------------
是要显示为html还是保存为html
------解决方案--------------------
String sFile = "\\qwe\\ind1ex.htm "; \\路径文件名
File f = new File(sFile);


FileWriter fw;
try
{
fw = new FileWriter(sFile);
fw.write( "前台页面得到的内容 ");

fw.close();
}
catch (IOException e)
{
e.printStackTrace();
}
------解决方案--------------------
不就是得到filename
new File(filename + ".html ")
然后File.write(content)不就行了
记得里面有一些html的特殊字符自己转化以下,比方说 <> ,转化为&lt;&gt;等等的
------解决方案--------------------
tt2451(很长很长很长很长很长很长很长很长很长很长很长很长很)

正解