如题,我用jsp写的一个问卷调查的页面,里面嵌套了些复杂的样式、JS。
现在有两个难点:
1、以邮件形式发送的话,邮件正文肯定得包含表单,比如radio表单,或者普通文本框之类的,这个怎么实现?或者需要注意什么
2、现在需要把这个页面通过邮件正文的形式发送出去,让客户作答,这就需要吧jsp转换成HTML。该如何转换呢?

解决方案 »

  1.   

    不用转呀,写在jsp页面中就可以了
      

  2.   

    HTML能办的事,JSP肯定能办得到
      

  3.   

    查看原文件,应该就可以看到了,我们看到的就是html静态页面
      

  4.   

    你能把html的转换成jsp的吗 ,反方系iangjiu 了
      

  5.   

    jsp通过编译成为class文件,然后再翻译成html文件
      

  6.   

    远程提交表单吧 action改成对应IP端口以及工程路径
    <form action="http://localhost:8080/test/servlet/test" method="post">
    然后把整个以html格式当做邮件正文发过去就行了
      

  7.   

    看了你们的回答,感觉都不大对劲呀。
    jsp编译成html,这个过程到底是怎么样的?咋都没提呀?
    查看源文件这个方法更是不可取的,需要通过程序实现的
      

  8.   

    jsp 部署后 第一次访问才编译成class文件
    但最终这个文件还是个servlet
      

  9.   


    先建立一个模板页面: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"; 
          String content="小样,还搞不定你?"; 
          String editer="Hulihutu";
          String filePath = "";
          filePath ="template.html"; 
          System.out.print(filePath);
          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);
          System.out.print(templateContent); 
          templateContent=templateContent.replaceAll("###title###",title); 
          templateContent=templateContent.replaceAll("###content###",content); 
          templateContent=templateContent.replaceAll("###author###",editer);// 替换掉模板中相应的地方 
          System.out.print(templateContent);       // 根据时间得文件名 
          Calendar calendar = Calendar.getInstance(); 
          String fileame = String.valueOf(calendar.getTimeInMillis()) +".html"; 
          fileame = "/" + fileame;// 生成的html文件保存路径。
          FileOutputStream fileoutputstream = new FileOutputStream(fileame);// 建立文件输出流  
          System.out.print("文件输出路径:"); 
          System.out.print(fileame);  
          byte tag_bytes[] = templateContent.getBytes(); 
          fileoutputstream.write(tag_bytes);
          fileoutputstream.close(); 
          }catch(Exception e){
            System.out.print(e.toString()); 
          } 
          } 
       }
      

  10.   

    不用转,jsp 发布以后 显示的是html
      

  11.   


    public class Test{
        private String name;
        private int age;
        public void setName(String name){
            this.name=name;
        }
        public String getName(){
            return this.name;
        }
        public void setAge(int age){
            this.age=age;
        }
        public int getAge(){
            return this.age;
        }
    }