zoukankan      html  css  js  c++  java
  • 完善成功

    11.25

    今天完成了对web代码的完善,没有遇道什么问题,明天计划再弄一个新的web系统。

    代码部分:

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page import="com.pp.DBU" %>
    <%@page import = "java.sql.*" %>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <%
    String sql="select * from xuesheng";
    Connection conn= DBU.getConnection();
    PreparedStatement papre=conn.prepareStatement(sql);
    ResultSet rs=papre.executeQuery();
    String n=request.getParameter("xingming");
    boolean s=true;
    session.setAttribute("xingming",n);
    while(rs.next()){
    if(n.equals(rs.getString("xingming"))){
    out.println(rs.getString("xuehao")+" &nbsp "+rs.getString("xingming")+" &nbsp "+rs.getString("banji")+" &nbsp "+rs.getString("kecheng")+" &nbsp "+rs.getString("fenshu")+" &nbsp ");
    out.print("<br />");
    s=false;
    }
    }
    %>
    <% if(s){
    %>
    <jsp:forward page = "wuci.jsp"></jsp:forward>
    <%
    }
    %>
    <form action="xiugai" method="get">
    <table>
    <tr>
    <td>学号</td>
    <td>
    <input type="text" name="xuehao" pattern="[0-9]{5}" title="只能输入数字或最后一位为X">
    </td>
    </tr>
    <tr>
    <td>姓名</td>
    <td>
    <input type="text" name="xingming">
    </td>
    </tr>
    <tr>
    <td>班级</td>
    <td>
    <input type="text" name="banji">
    </td>
    </tr>
    <tr>
    <td>课程</td>
    <td>
    <input type="text" name="kecheng">
    </td>
    </tr>
    <tr>
    <td>分数</td>
    <td>
    <input type="text" name="fenshu">
    </td>
    </tr>


    <tr align="center">
    <td colspan="2">
    <input type="submit" value="提交">
    </td>
    <td colspan="2">
    <input type="submit" value="返回" formaction="guanli.jsp">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <form action="update.jsp" border="1">
    <table align = "center" border = "1">
    <tr>
    <td>请输入要修改的名称:</td>
    <td>
    <input type="text" name="xingming">
    </td>
    </tr>
    <tr align="center">
    <td colspan="2">
    <input type="submit" value="确定">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <form action="xuesheng" method="get">
    <table align="center" border="1">
    <tr>
    <td>学号</td>
    <td>
    <input type="text" name="xuehao">
    </td>
    </tr>
    <tr>
    <td>姓名</td>
    <td>
    <input type="text" name="xingming">
    </td>
    </tr>
    <tr>
    <td>班级</td>
    <td>
    <input type="text" name="banji">
    </td>
    </tr>
    <tr>
    <td>课程</td>
    <td>
    <input type="text" name="kecheng">
    </td>
    </tr>
    <tr>
    <td>分数</td>
    <td>
    <input type="text" name="fenshu">
    </td>
    </tr>
    <tr align="center">
    <td colspan="2">
    <input type="submit" value="提交">
    </td>
    <td colspan="2">
    <input type="submit" value="返回" formaction="guanli.jsp">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

  • 相关阅读:
    深入研究Servlet线程安全性问题
    Sun公司java语言编码规范
    JAVA的内省机制(introspector)与反射机制(reflection)[转]
    Oracle的悲观锁和乐观锁
    java中120个经典问题
    自定义Java异常
    Java事务处理总结
    Tomcat内存溢出的三种情况及解决办法分析
    .net基础
    C#.Net中的转义
  • 原文地址:https://www.cnblogs.com/092e/p/14170080.html
Copyright © 2011-2022 走看看