程序从一个表单输入信息,根据提交的信息,生成一个表格
已经经过两个朋友的修改了 但是还是不能运行错误信息是这样的
description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 40 in the jsp file: /makepage.jspGenerated servlet error:
    [javac] Compiling 1 source fileC:\server\Tomcat\work\Standalone\localhost\mytest\makepage_jsp.java:91: cannot resolve symbol
symbol  : variable content 
location: class org.apache.jsp.makepage_jsp
      out.print(content);
                ^
1 error
以下是程序的代码html代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body>
<form name="frm" method="post" action="makepage.jsp">
  <table>
  <tr>
  <td>
  标题内容
  </td>
  <td>
  <textarea name="title"></textarea>
  </td>
  </tr>
  <tr>
  <td>
  背景颜色
  </td>
  <td>
  <select name="bgcolor">
  <option value="red">红色</option>
  <option value="blue">蓝色</option>
  <option value="yellow">黄色</option>
  </select>
  </td>
  </tr>
  <tr>
  <td>
  字体颜色
  </td>
  <td>
  <select name="text">
  <option value="blue">蓝色</option>
  <option value="red">红色</option>
  <option value="yellow">黄色</option>
  </select>
  </td>
  </tr>
  <tr>
  <td>
  字体大小
  </td>
  <td>
  <input type="text" name="fontsize">
  </td>
  </tr>
  <tr>
  <td>
  文字内容
  </td>
  <td>
  <textarea name="content"></textarea>
  </td>
  </tr>
  <tr>
  <td>
  表格行数
  </td>
  <td>
  <input type="text" name="row">
  </td>
  </tr>
  <tr>
  <td>
  表格列数
  </td>
  <td>
  <input type="text" name="list">
  </td>
  </tr>
  </table>
  <input type="submit" name="submit" value="提交" >
  <input type="reset" name="reset" value="重添" >
</form>
</body>
</html> jsp代码:
<%
try
{
String title =request.getParameter("title");
String bgcolor=request.getParameter("bgcolor");
String text=request.getParameter("text");
String fontsize=request.getParameter("fontsize");
String row=request.getParameter("row");
String list=request.getParameter("list");
String concent=request.getParameter("concent");
int int_row=0;
int int_list=0;
if(!fontsize.equals(""))
{
int int_fontsize=Integer.parseInt(fontsize);
}
if(!row.equals(""))
{
int_row=Integer.parseInt(row);
}
if(!list.equals(""))
{
int_list=Integer.parseInt(list);
}
if(bgcolor.equals(text))
{
%>
输入背景颜色和字体颜色不能相同!
<a href="index.html">请点击这里从新输入</a>
<%
}else
{
%>
    <html>
     <title>
     <%=title%>
     </title>
     <body bgcolor="<%=bgcolor%>" text="<%=text%>">
     <center>
     <Font size="<%=fontsize%>"><%=content%></Font>
     <table>
     <%
     for(int i=0;i<int_row;i++)
     {
     %>
       <tr>
     <%
       for(int j=0;j<int_list;j++)
       {
     %>
       <td>
     <input type="text" name="name<%=i%><%=j%>">
       </td>
     <%
       }
     %>
       </tr>
     <%
       }
     %>
     </table>
    </center>
  </body>
</html>
<%
 }
 }
 catch(Exception e)
 {
 %>
 输入的是非数字!
<a href="index.html">请点这里重新输入</a>
 <%
 }
 %>
 

解决方案 »

  1.   

    out.print(content);都说了你这里的变量打错了。要写成out.print(concent);
    请仔细些。
      

  2.   

    content意思是内容
    concent不是个单词
    看来楼主一开始就犯错了呵呵
      

  3.   

    。。
    我已经把concent改成了content但是还是不行显示org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 40 in the jsp file: /makepage.jspGenerated servlet error:
        [javac] Compiling 1 source fileC:\server\Tomcat\work\Standalone\localhost\mytest\makepage_jsp.java:91: cannot resolve symbol
    symbol  : variable content 
    location: class org.apache.jsp.makepage_jsp
          out.print(content);
                    ^
    1 error
    我晕了 再给我看看吧 谢谢
      

  4.   

    String concent=request.getParameter("content");
    ?????