程序从一个表单输入信息,根据提交的信息,生成一个表格
已经经过两个朋友的修改了 但是还是不能运行错误信息是这样的
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>
<%
}
%>
已经经过两个朋友的修改了 但是还是不能运行错误信息是这样的
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>
<%
}
%>
解决方案 »
- 高手帮帮,急,谢了
- 高分求解?项目不报错,数据也插入部了数据库,贴出重要代码,请高手帮忙解决!!s2sh 虽然文件很多,但很简单的,我真的找不出什么原因,谢谢大家了
- window.open()第二个参数有什么用途?js高手进
- JAVA中怎么实现获得当前工作日期和时间?
- 请教诸位,jsp中out.write()与out.print()的区别是什么?
- 怎样把一个FileInputStream对象,转换为一个序列化对象
- 求教:Servlet源程序的编译问题!!!
- "是" 请问 ' 是什么?
- 求助,tomcat 7 中报错,无法理解
- eclipse SVN 问题请教
- 关于数据库连接池的一个代码
- 请教 tomcat下的程序移植到jdeveloper里出现的问题
请仔细些。
concent不是个单词
看来楼主一开始就犯错了呵呵
我已经把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
我晕了 再给我看看吧 谢谢
?????