5 个解决方案
#1
关注!shtml就是动态生成的吧?
#2
<%
String sHtml="Your Content"
WriteFileBean tempFile=new WriteFileBean();
tempFile.localpath="path";
tempFile.FileName="fielName.html";
tempFile.WriteFile(sHtml);
%>
<%!
public class WriteFileBean
{
public String localpath;
public String FileName;
public WriteFileBean()
{
}
public void WriteFile(String str)//with date record
{
try
{
java.util.Date now = new java.util.Date();
str = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(str))))));
str = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(str)))).append('\r').append('\n')));
FileWriter fw = new FileWriter(String.valueOf(String.valueOf(localpath)).concat(FileName), false);
for(int i = 0; i < str.length(); i++)
{
fw.write(str.charAt(i));
}
fw.close();
}
catch(IOException ioexception) { }
}
}
%>
String sHtml="Your Content"
WriteFileBean tempFile=new WriteFileBean();
tempFile.localpath="path";
tempFile.FileName="fielName.html";
tempFile.WriteFile(sHtml);
%>
<%!
public class WriteFileBean
{
public String localpath;
public String FileName;
public WriteFileBean()
{
}
public void WriteFile(String str)//with date record
{
try
{
java.util.Date now = new java.util.Date();
str = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(str))))));
str = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(str)))).append('\r').append('\n')));
FileWriter fw = new FileWriter(String.valueOf(String.valueOf(localpath)).concat(FileName), false);
for(int i = 0; i < str.length(); i++)
{
fw.write(str.charAt(i));
}
fw.close();
}
catch(IOException ioexception) { }
}
}
%>
#3
完了,信誉值那么低,肯定不会给分了!
#4
有个笨办法,在数据库里存一个html template,里面设置%title%, %content%之类的项目,用java读出template并替换那些项目,再写成file存到硬盘
#5
http://expert.csdn.net/Expert/topic/2571/2571038.xml?temp=2.300662E-02
#1
关注!shtml就是动态生成的吧?
#2
<%
String sHtml="Your Content"
WriteFileBean tempFile=new WriteFileBean();
tempFile.localpath="path";
tempFile.FileName="fielName.html";
tempFile.WriteFile(sHtml);
%>
<%!
public class WriteFileBean
{
public String localpath;
public String FileName;
public WriteFileBean()
{
}
public void WriteFile(String str)//with date record
{
try
{
java.util.Date now = new java.util.Date();
str = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(str))))));
str = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(str)))).append('\r').append('\n')));
FileWriter fw = new FileWriter(String.valueOf(String.valueOf(localpath)).concat(FileName), false);
for(int i = 0; i < str.length(); i++)
{
fw.write(str.charAt(i));
}
fw.close();
}
catch(IOException ioexception) { }
}
}
%>
String sHtml="Your Content"
WriteFileBean tempFile=new WriteFileBean();
tempFile.localpath="path";
tempFile.FileName="fielName.html";
tempFile.WriteFile(sHtml);
%>
<%!
public class WriteFileBean
{
public String localpath;
public String FileName;
public WriteFileBean()
{
}
public void WriteFile(String str)//with date record
{
try
{
java.util.Date now = new java.util.Date();
str = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(str))))));
str = String.valueOf(String.valueOf((new StringBuffer(String.valueOf(String.valueOf(str)))).append('\r').append('\n')));
FileWriter fw = new FileWriter(String.valueOf(String.valueOf(localpath)).concat(FileName), false);
for(int i = 0; i < str.length(); i++)
{
fw.write(str.charAt(i));
}
fw.close();
}
catch(IOException ioexception) { }
}
}
%>
#3
完了,信誉值那么低,肯定不会给分了!
#4
有个笨办法,在数据库里存一个html template,里面设置%title%, %content%之类的项目,用java读出template并替换那些项目,再写成file存到硬盘
#5
http://expert.csdn.net/Expert/topic/2571/2571038.xml?temp=2.300662E-02