showcourse.jsp

来自「本源码主要从数据库的开发过程出发」· JSP 代码 · 共 88 行

JSP
88
字号
<%--     Document   : ShowCourse    Created on : 2008-5-9, 9:18:33    Author     : Administrator--%><%@page contentType="text/html" pageEncoding="GBK"%><%@ page import="java.sql.*" %><jsp:useBean id="userinf" scope="session" class="Source.userInf" /><jsp:useBean id="jdbcBean" scope="session" class="Source.JDBCBean"/><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><%          String cid = request.getParameter("CId");            String showcid = "<th  scope='col'>课程名</th><th  scope='col'>课程内容</th>";            if (userinf.isHasLogin()) {                ResultSet rs;                String sql = "select * from course where courseId=" + cid;                if (cid == null || cid.equals("")) {                    showcid = "<tr><td><input type='text' name='CId' size='20'></td>" +                            "<td><input type='submit' value='Submit'></td></tr>";                } else {                    rs = jdbcBean.executeQuery(sql);                    if (rs.next()) {                        showcid += "<tr><td>" + rs.getString("courseName") +                                "</td><td>" + rs.getString("dir") +                                "</td></tr>";                    }                    jdbcBean.close();                    rs.close();                }            } else {                session.setAttribute("inf", "请重新登录!");                session.setAttribute("returnStr", "<a href='Login.jsp'>Return</a>");                response.sendRedirect("Information.jsp");            }%><html>    <head>        <meta http-equiv="Content-Type" content="text/html; charset=GBK" />        <title>Show Course</title>        <style type="text/css">            <!--            #main {                background-color: #CCCCCC;                width: 750px;                margin-right: auto;                margin-left: auto;                padding-bottom: 30px;                padding-top: 30px;            }            #main #title {                background-position: center;                background-color: #FFFFFF;                width: 600px;                margin-right: auto;                margin-left: auto;                vertical-align: text-top;                text-align: center;                padding-top: 20px;                padding-bottom: 20px;            }            .STYLE3 {                width: 600px;                background-color: #666666;                margin-right: auto;                margin-left: auto;                font-size: xx-large;                font-weight: bold;                color: #FFFFFF;            }            -->        </style>    </head>    <body>        <div id="main">            <div class="STYLE3" id="content">Show Course</div>            <div id="title">                <form action="ShowCourse.jsp">                    <table align="center" border="1">                        <%=showcid%>                    </table>                </form>            </div>        </div>    </body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?