好象是index.jsp?id=5 转换为index.html大概是这个意思,就是把动态的代码转换为静态的

解决方案 »

  1.   

    将这个 jsp 部署起来,用浏览器打开这个 jsp 页面,然后在浏览器中查看页面源代码即可。
      

  2.   

    1.url rewrite
    2.内容管理系统(CMS)
      

  3.   

    没有办法的办法 用URLConnection 打开你的index......读出流,写入index.html文件,就ok了
      

  4.   

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
        <%@ page import="java.util.*,java.io.*"%> 
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body><% 
    try{ 
    String title="This is Title"; 
    String content="This is Content Area"; 
    String editer="LaoMao"; 
    String filePath = ""; 
    filePath = request.getRealPath("/")+"template.html"; 
    //out.print(filePath+"<br>"); 
    String templateContent=""; 
    FileInputStream fileinputstream = new FileInputStream(filePath);//读取模块文件 
    int lenght = fileinputstream.available(); 
    byte bytes[] = new byte[lenght]; 
    fileinputstream.read(bytes); 
    fileinputstream.close(); 
    templateContent = new String(bytes); 
    //out.print(templateContent); 
    templateContent=templateContent.replaceAll("###title###",title); 
    templateContent=templateContent.replaceAll("###content###",content); 
    templateContent=templateContent.replaceAll("###author###",editer);//替换掉模块中相应的地方 
    //out.print(templateContent); 
    // 根据时间得文件名 
    Calendar calendar = Calendar.getInstance(); 
    String fileame = String.valueOf(calendar.getTimeInMillis()) +".html"; 
    fileame = request.getRealPath("/")+fileame;//生成的html文件保存路径 
    FileOutputStream fileoutputstream = new FileOutputStream(fileame);//建立文件输出流 
    byte tag_bytes[] = templateContent.getBytes(); 
    fileoutputstream.write(tag_bytes); 
    fileoutputstream.close(); 

    catch(Exception e){ 
    out.print(e.toString()); 

    %> </body>
    </html>
      

  5.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <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###</td> 
       </tr> 
       <tr>  
         <td align="center">author:###author###&nbsp;&nbsp;</td> 
       </tr> 
       <tr> 
         <td>###content###</td> 
       </tr> 
    </table> 
    </body> 
    </html>