jsp如何实现自动生成HTML页面

来源:百度知道 编辑:UC知道 时间:2024/05/16 10:29:06
就是我要执一段JSP代码(输入一段文章) 然后他会把这篇文章对应的生成HTML代码,希望好心人能够帮忙 最好是具体点~或者是相关的文章~在此先谢了~

先建立一个模板页面:template.htm
<html><head><title>###title###</title>
<meta http- equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="../css.css" rel=stylesheet type=text/css></head>
<body>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="2">
<tr><td align="center">###title###</tr>
<tr><td align="center">作者:###author###</tr>
<tr><td align="center">###content###</td></tr>
</table>
</body>
</html>

再写一个Java页面: buildhtml.java:

import java.util.*;
import java.io.*;
public class HtmlFile{
public static void main(String[] args){
try{
String title="Make Html";
Str