最好给一个能使用的工具, 有比较详细的说明 , 可以短时间内上手使用!或者给出该实现的方法, 能有详细的文档最好.能给工具就给工具 , 实在没有就给个文档我试着做一下. 两个都给就更好了谢谢各位!   万分着急!

解决方案 »

  1.   

    编写一个程序,读取jsp的url链接内容,并输出到html文件中即可,不过要根据具体的情况而定的。
      

  2.   

    给个详细的实现好么?
    怎么在读到循环等需要调用数据库的时候调用数据库内容并插入html中呢?
      

  3.   

    我原来写过,但现在找不到代码了,你可以想象,你用浏览器显示一个jsp页面还要管数据库链接啊,不用吧,其实你的工作就是把浏览器显示html内容写到一个html文件里,这过这里是用程序实现而已。
      

  4.   

    用shtml吧,支持include语法,效率只比html低一点点。
      

  5.   

    用shtml吧,支持include语法,效率只比html低一点点。   有资料么?
    就是生成HTML文件吧?  没错,是要生成html文件,为了加快速度, 有资料么?谢谢,请帮忙
      

  6.   

    <%@ page contentType="text/html; charset=GBK" language="java" import="java.sql.*,javax.sql.*,java.util.*,java.io.*" errorPage="" %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=GBK">
    <title>生成静态文件</title>
    <link href="../css/style.css" rel="stylesheet" type="text/css"/>
    <script language=vbscript>
    Function bytes2BSTR(vIn)
        strReturn = ""
        For i = 1 To LenB(vIn)
            ThisCharCode = AscB(MidB(vIn, i, 1))
            If ThisCharCode < &H80 Then
                strReturn = strReturn & Chr(ThisCharCode)
            Else
                NextCharCode = AscB(MidB(vIn, i + 1, 1))
                strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
                i = i + 1
            End If
        Next
        bytes2BSTR = strReturn
    End Function
    </script>
    <script language=javascript>
    function sendMsg(url){
    var oSend = new ActiveXObject("Microsoft.XMLHTTP");
    var sS="aa=1";
        oSend.open("POST",url,false);
        oSend.setRequestHeader("Content-Length",sS.length);  
        oSend.setRequestHeader("CONTENT-TYPE","application/x-www-form-urlencoded");
        oSend.send(sS);
        var oDom = new ActiveXObject("Microsoft.XMLDOM");
        oDom.async = false;
    body='<\%@ page contentType="text/html; charset=GBK" language="java" \%>';
        body = body+bytes2BSTR(oSend.responseBody);
    //body = body+oSend.responseBody;
    //alert(body);
    document.form1.txtA.value=body;
    }
    </script>
    </head><body onload=sendMsg("url")><!-- 要生成静态页的动态页url -->
    <form name=form1 method=post>
    <div align="center"> </div>
    <div align="center"> 
      <table class=tableBorder cellspacing=1 cellpadding=3 align=center border=0>
        
          <tbody> 
          <tr align="left"> 
            <th height="20" background="images/admin_bg_1.gif" class=tableHeaderText> 
              <div class="style5"> 
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td><span class="style6">&nbsp;&nbsp;&nbsp;</span></td>
                    <td align="right">&nbsp; </td>
                  </tr>
                </table>
              </div>
            </th>
          </tr>
          <tr> 
            <th bgcolor="#E4EDF9" class=tableHeaderText style3> 
              <div align="left"> 
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td height="24" width="15%" align="center">内容:<br>
                    </td>
                    <td height="24" width="85%"><b> 
                      <textarea name="txtA" cols="80" rows="30" readonly></textarea>
                      </b></td>
                  </tr>
                </table>
              </div>
              <div align="left"><span class="text"> </span> <span class="text"> </span> 
              </div>
              <div align="left"> <span class="text"> </span> </div>
            </th>
          </tr>
          <tr align="right"> 
            <th bgcolor="#F1F3F5" class=tableHeaderText style2 align="center"> <span class="forumrow"> 
              &nbsp; &nbsp; 
              <INPUT type=submit value=确定 name=Submit310322>
              <input type=reset value=取消 name=Submit310222>
              </span></th>
          </tr>
          <tr> 
            <th bgcolor="#E4EDF9" class=tableHeaderText style3> 
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr align="center"> 
                  <td height="24" width="15%"><br>
                  </td>
                  <td height="24" width="85%"><b></b></td>
                </tr>
              </table>
            </th>
          </tr>
          </tbody> 
       
      </table>
      <br>
      <p>&nbsp;</p>
    </div>
    <p align="center" class="style4"></p>
    <span class="forumrow"></span> 
    </form>
    </body>
    </html>
    <%
    String txtA=request.getParameter("txtA");
    com.xxx.StringHandle handle = new com.xxx.StringHandle();
    if(txtA!=null){
    String path=getServletContext().getRealPath("/");
    path=path+"/index.htm";//要生成的静态页
    FileWriter writer= new FileWriter(path);
    writer.write(txtA);
    writer.close();
    out.println(handle.getJsAlert("首页生成成功!!!",""));
    }
    %>
      

  7.   

    T_space(T_space) 兄: 多谢, 我试试看 , 有不懂的再请教你! 谢谢
      

  8.   

    xiongxa(熊熊)
    老兄, 兄弟我正着急呢,别开玩笑好不好.真心帮我就给点象样的办法, 谢了
      

  9.   

    先看看这个:
    http://www.diaor.com/blog/article.asp?id=53我指可以不必整体生成htm,可以局部做。比如index.htm可以拆分成header.htm,footer.htm,其它更新.htm...就像搭积木,维护也比较容易。只是index.htm换成index.shtml至于如何在服务器端生成一个文件,这个例子太多了,网上搜一下。算了,还是贴点代码给你吧。
    //...................................
    import java.io.File;
    import java.io.FileOutputStream;
    //...................................
    file = new File("D:\index.htm");
    FileOutputStream fout = new FileOutputStream(file);
    fout.write(b);
    fout.close();
    //...................................
      

  10.   

    byte[] b = html文件数据.toString().getBytes();
      

  11.   

    real0411(大头牛)
    兄弟,多谢了,我试试看.
      

  12.   

    要学会自己学习
    /*
     * Created on 2006-3-4
     *
     * To change the template for this generated file go to
     * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
     */
    package com.easydone.cn.tools.utils;import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.util.Date;/**
     * @author Administrator
     *
     * To change the template for this generated type comment go to
     * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
     */
    public class MakeHtml {
    private static long star = 0;
    private static long end = 0;
    private static long ttime = 0;

    //返回html代码
    public static String getHtmlCode(String httpUrl){
    Date before = new Date();
    star = before.getTime();
    String htmlCode = "";
    try {
    InputStream  in;
    URL url = new java.net.URL(httpUrl);
    HttpURLConnection connection = (HttpURLConnection)url.openConnection();
    connection = (HttpURLConnection) url.openConnection();
    connection.setRequestProperty("User-Agent","Mozilla/4.0");
    connection.connect();
    in = connection.getInputStream();
    java.io.BufferedReader breader = new BufferedReader(new InputStreamReader(in , "GBK"));
    String currentLine;
      while((currentLine=breader.readLine())!=null){
    htmlCode+=currentLine;
      }
    } catch (Exception e) {
    e.printStackTrace();
    }finally{
    Date after = new Date();
    end = after.getTime();
    ttime = end-star ;
    System.out.println("执行时间:"+ttime +"秒");
    }
    return htmlCode;
    }
    //存储文件
    public static synchronized void writeHtml(String filePath,String info,String flag) {

    PrintWriter pw = null;
    try {
    File writeFile = new File(filePath);
    boolean isExit = writeFile.exists();
    if (isExit != true) {
    writeFile.createNewFile();
    } else {
    if (!flag.equals("NO")) {
    writeFile.delete();
    writeFile.createNewFile();

    }
    pw = new PrintWriter(new FileOutputStream(filePath, true));
    pw.println(info);
    pw.close();
    } catch (Exception ex) {
    System.out.println(ex.getMessage());
    }finally{
    pw.close();
    }
    }

    public static void main(String[] args) {
    String url = "http://www.easydone.cn/index.htm";
    writeHtml("c:/demo.htm",getHtmlCode(url),"NO");
    }
    }