jsp中下拉列表动态显示值?????????
在stu_exam_choose.jsp中有
<form name="stu_exam_choose_form" action="exam.do?operate=toStu_exam_list" method="post" id="stu_exam_choose_form">
<div class="tab-content" id="tab2">
<div class="notification information png_bg">
<div>
<div class="success" id="advExam" style="display:none">
<table width="760" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="114" align="right"><div align="right"><span class="STYLE4">系别:</span></div></td>
<td width="153"><select name="select">
<option selected>--请选择系别--</option>
<logic:iterate id="examDepartment" name="getDepartment_list" type="com.aftvc.exam.entity.Exam" >
<option value="${eDepartment.stu_department_id}">
${studentDepartment.stu_department_name}
</logic:iterate>
</select>
</td>
<td width="101"><div align="right"><span class="STYLE4">班级:</span></div></td>
<td width="155"><select name="select2">
<option>--请选择班级--</option>
</select></td>
<td width="84"><div align="right"><span class="STYLE4">科目:</span></div></td>
<td width="153"><select name="select3">
<option>--请选择科目--</option>
</select></td>
</tr>
</table>
</div>
<div class="content-box">
<!-- Start Content Box -->
<!-- End .content-box-header -->
<div class="content-box-content">
<div class="tab-content default-tab" id="tab1">
<!-- This is the target div. id must match the href of this div's tab -->
<div class="notification attention png_bg">
<div class="STYLE4"> 以下是您可以参加的考试科目,点击参加按钮即可参加该门考试科目</div>
</div>
<table>
<thead>
<tr>
<th width="55" height="22" class="table-teac-pro-view-top-left"> 考试分类</th>
<th width="161" class="table-teac-pro-view-top">考试名称</th>
<th width="50" align="center" class="table-teac-pro-view-top">分数</th>
<th width="93" class="table-teac-pro-view-top">总时间</th>
<th width="94" class="table-teac-pro-view-top">开始时间</th>
<th width="95" class="table-teac-pro-view-top-right">是否参加</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="6" class="table-teac-pro-view-down-left-right"><div class="bulk-actions align-left">
<select name="dropdown">
<option>--请选择排列方式--</option>
</select>
<a class="button" href="#">按进行排列</a> </div>
<div class="pagination"> <a href="#" title="First Page">«首页</a><a href="#" title="Previous Page">« 上一页</a> <a href="#" class="number" title="1">1</a> <a href="#" class="number" title="2">2</a> <a href="#" class="number current" title="3">3</a> <a href="#" class="number" title="4">4</a> <a href="#" title="Next Page">下一页 »</a><a href="#" title="Last Page">尾页»</a> </div>
<!-- End .pagination -->
<div class="clear"></div></td>
</tr>
</tfoot>
<tbody>
<logic:iterate id="exam" name="stu_exam_choose_list" type="com.aftvc.exam.entity.Exam" >
<tr>
<td align="center" class="table-teac-pro-view-left">${exam.em_exam_type}</td>
<td class="table-teac-pro-view-centent" align="center"><a href="#" title="title">${exam.em_exam_name }</a></td>
<td class="table-teac-pro-view-centent" align="center">${exam.em_total_score}分</td>
<td class="table-teac-pro-view-centent" align="center">${exam.em_totaltime}分钟</td>
<td class="table-teac-pro-view-centent" align="center"><!-- Icons -->
<%String i = exam.getEm_examdate().toString();
i=i.substring(0,9);%>
<%=i %>
</td>
<th class="table-teac-pro-view-right" align="center"><input name="Submit22" type="button" class="button-stu-exam-view" value=" 参 加 " onclick="viewSubmit();" /></th>
</tr>
</logic:iterate>
</tbody>
</table>
</div>
我选中所选的系,就跟据下拉列表动态显示数据!!
在struts action中有代码
public ActionForward toStu_exam_choose(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws IOException {
PrintWriter out = response.getWriter();
ExamForm examForm = (ExamForm) form;// TODO Auto-generated method stub
//out.println("<script>window.open('login.html')</script>");
HttpSession session=request.getSession();
Student student=(Student)session.getAttribute("student");
List getDepartment_list=examInfoBiz.getExamDepartment_name();
List stu_eaxm_choose_list=examInfoBiz.getStudentExamChoose(student,exam);
session.setAttribute("stu_exam_choose_list", stu_eaxm_choose_list);
session.setAttribute("getDepartment_list", getDepartment_list);
return mapping.findForward("stu_exam_choose");
}
在Java中有代码
/***
* 显示学生可以参加的考试信息,显示试卷列表
*/
public List getStudentExamChoose(Student student,Exam exam){
List list=new ArrayList();
super.openConn();
try{
String sql="select *from exammanage_info where em_state='通过' and em_examstate='待用' and em_exam_code not in ( select sm_exam_code from scoremanage_info ) or '"
+student.getStu_id()+
"' not in (select sm_stu_id from scoremanage_info) ";//不在成绩表的学生和科目可以显示试卷
if(null!=exam){
if(exam.getDepartment_id()!=0){
sql+="and exammanage_info.em_department_id="+exam.getDepartment_id()+" ";
}
if(exam.getDepartment_id()!=0){
sql+="and exammanage_info.em_class_id="+exam.getDepartment_id()+" ";
}
if(exam.getSq_subject_id()!=0)
{
sql+="and exammanage_info.em_subject_id="+exam.getSq_subject_id()+" ";
}
}
pstmt=conn.prepareStatement(sql);
rs=pstmt.executeQuery();
while(rs.next())
{
exam=new Exam();
exam.setEm_exam_type(rs.getString("em_exam_type"));
exam.setEm_exam_name(rs.getString("em_exam_name"));
exam.setEm_total_score(rs.getFloat("em_total_score"));
exam.setEm_totaltime(rs.getInt("em_totaltime"));
exam.setEm_examdate(rs.getString("em_examdate"));
exam.setEm_total_score(rs.getFloat("em_total_score"));
list.add(exam);
}
}catch(Exception e)
{
e.printStackTrace();
System.out.print("数据库连接错误!");
}
finally{
super.closeAll();
}
return list;
}
为什么选中下拉列表中的内容,他没有动态显示效果,谁能帮我改一下,看哪里错了!!!!!!!!!拜托各位了!!!!