我想让学分字段进入文本里,高手看看!
最近用JSP在做一个选课系统,哪位仁兄做过,帮帮忙!
我数据库里有表:student(studentcode,name,sex,password)
kecheng(coursecode,coursename,credithour,maxstudents)
xuanke(studentcode,coursecode,scoresum)
现在选课出了点问题,在一个界面中通过下拉列表选择学号,课程号,
我想让学分自动的跳出来,因为一门课程的学分是固定的.
我用二层模型!出现问题的代吗如下:
<%@ page contentType= "text/html; charset=gb2312 " language= "java "
import= "java.sql.*,java.util.*,xuanke.* "
errorPage= " " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无标题文档 </title>
</head>
<jsp:useBean id= "student " class= "xuanke.Student "scope= "request "/>
<jsp:useBean id= "studentbean " class= "xuanke.StudentBean "scope= "request "/>
<jsp:useBean id= "kecheng " class= "xuanke.Kecheng "scope= "request "/>
<jsp:useBean id= "kechengbean " class= "xuanke.KechengBean "scope= "request "/>
<body>
<center>
<form name= "form2 " method= "post " action= "xuanke_do.jsp ">
<table width= "415 ">
<tr>
<td width= "233 " height= "40 "> 请选择学号:
<select name= "studentcode ">
<%
Collection t=studentbean.getStudent();
Iterator it=t.iterator();
while(it.hasNext())
{
Student stu=(Student)it.next();
out.println( " <option value= "+stu.getSno()+ "> "+stu.getName()+ " </option> ");
}
%>
</select> </td>
<td width= "170 " height= "26 "> 请选择课程:
<select name= "coursecode ">
<%
Collection f=kechengbean.getKecheng();
Iterator its=f.iterator();
while(its.hasNext())
{
Kecheng