• 2020 11 2


    浏览课程界面:

    <%@ page language="java" contentType="text/ html; charset=UTF-8"
    pageEncoding="UTF-8" import = "java.util.*"%>
    <%@page import="bean.student"%>
    <%@page import="bean.tclass"%>
    <%@page import="bean.teacher"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <%
    student Astudent=(student)session.getAttribute("Astudent");
    if(Astudent==null)
    {
    Astudent=(student)session.getAttribute("Astudent");
    }
    List<tclass> Atclass=(List<tclass>)session.getAttribute("Atclass");
    List<tclass> Atclass1=(List<tclass>)session.getAttribute("Atclass1");
    List<teacher> Ateacher=(List<teacher>)session.getAttribute("Ateacher");
    out.println(Astudent.getName());
    String classs[]=Astudent.getCclass().split("\+");
    session.setAttribute("Astudent",Astudent);
    request.setAttribute("Astudent",Astudent);
    session.setAttribute("Atclass",Atclass);
    request.setAttribute("Atclass",Atclass);
    session.setAttribute("Atclass1",Atclass1);
    request.setAttribute("Atclass1",Atclass1);
    session.setAttribute("Ateacher",Ateacher);
    request.setAttribute("Ateacher",Ateacher);
    %>
    <form action="Saddc1.jsp" method="post" onsubmit="return chech(this)">
    <table align="center" width="450" border="1">
    <tr>
    <td align="center" colspan="5">
    <h2>浏览课程</h2>
    </td>
    </tr>
    <tr aligh="center">
    <td>课程编号</td>
    <td>课程名称</td>
    <td>选课人数</td>
    <td>任课教师</td>
    <td>人数上限</td>
    </tr>
    <%
    for(tclass p:Atclass1){
    for(String q:classs)
    {
    if(q.equals(p.getName()))
    {
    %>
    <tr aligh="center">
    <td><%=p.getID() %></td>
    <td><%=p.getName()%></td>
    <td><%=p.getSum() %></td>
    <td><a href="Slook1.jsp?tID=<%=p.gettID()%>"><%=p.getTeacher()%></a></td>
    <td><%=p.getNum() %></td>
    <br>
    </tr>
    <%
    }
    }
    }
    %>
    <td><a href="user.jsp">注销</a></td>
    <td><a href="loginS.jsp">返回上一级</a></td>
    </table>
    </form>
    </body>
    </html>

  • 相关阅读:
    Day5下午解题报告1
    Linux 命令整理
    [置顶] 正则表达式应用:匹配email地址
    IE浏览器下web调试工具之--IE WebDeveloper介绍
    ORACLE客户端乱码
    冒泡排序
    【C++】第二章:Hello World!
    hdu4710
    (SQL SERVER) (ORACLE) (ACCESS)(POSTGRE SQL)四种数据库操作C#代码
    How to calculate the undo_retention time
  • 原文地址:https://www.cnblogs.com/fuxw4971/p/14203235.html
Copyright © 2020-2023  润新知