1

我正在从表单中发送 5 个值,它们是名称、电子邮件、密码、确认密码和城市,但是当执行此代码时,我得到了指定的错误

代码:

    <%---<%@ page errorPage="addbookerror.jsp" %> --%>
<%@ page import="java.sql.*"  %>
 <%@ page import="bean.*" %>
<%@ page import="database.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<title></title>
</head>
<body>
<jsp:useBean id="d" class="database.studentDAO" scope="page"></jsp:useBean>
<jsp:useBean id="s" class="bean.studentInfo" scope="page"></jsp:useBean>
<jsp:setProperty name="s" property="name" param="st_name"/>
<jsp:setProperty name="s" property="email" param="st_email"/>
<jsp:setProperty name="s" property="pwd" param="st_password"/>
<jsp:setProperty name="s" property="cpwd" param="st_confirm_password"/>
<jsp:setProperty name="s" property="city" param="st_city"/>
<%
d.addStudent(s);

%>

</body>
</html>

错误:

org.apache.jasper.JasperException: An exception occurred processing JSP page /Admin/add_st_ac.jsp at line 20

17: <jsp:setProperty name="s" property="cpwd" param="st_confirm_password"/>
18: <jsp:setProperty name="s" property="city" param="st_city"/>
19: <%
20: d.addStudent(s);
21: 
22: %>
23: 
4

1 回答 1

0

您能否显示您正在使用的学生数据库(数据库代码)的架构以及实际addStudent定义?

很可能您手动尝试在addStudent函数中构建查询,但无法填充所需的所有列。

于 2013-06-23T06:53:47.983 回答