zoukankan      html  css  js  c++  java
  • 软工概论第一周动手动脑

    一.需要网站系统开发需要掌握的技术

    1.java语言

    1. 面向对象思想
    2. 设计模块和框架思想
    3. xml语言
    4. 网页脚本语言
    5. 数据库
    6. 应用服务器
    7. 集成开发环境

    二.本次课堂测试的源程序代码

    //登录页面
    
    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <head>
    
    <title>登录页面</title>
    
    </head>
    
    <body>
    
    <form name="form1" action="judge.jsp" method="get" onSubmit="check()">
    
    <h1>用户登录</h1>
    
        <table align="center" border="1" width="500">
    
        <tr>
            <td>用户名称 : </td>
            <td><input type="text" name="username" /></td>
        </tr>
    
        <tr>
             <td>用户密码:</td>
             <td><input type="password" name="password" /> </td>              
        </tr>
    
             <tr align="center">
    
             <td colspan="2"> <input type="submit" value="登录" />
    
          <input type="reset" value="注册" onclick="addInput.jsp" />
    
             </td>
    
         </tr>
    
    </table>
    
    </form>
    
     
    
    <script type="text/javascript">
    
      function check(){
    
      if(form1.username.value==""){
    
      alert("请输入用户名!");
    
      form1.username.focus();
    
      return;
    
      }
    
      else if(form1.password.value==""){
    
      alert("请输入密码!");
    
      form1.password.focus();
    
      return;
    
      }
    
      return true;
    
    }
    
    </script>
    
    </body>
    
    </html>    
    //判断页面
    
    <%@page import="com.jaovo.msg.Util.UserException"%>
    
    <%@page import="com.jaovo.msg.dao.UserDaoImpl"%>
    
    <%@page import="com.jaovo.msg.model.User"%>
    
    <%@ page language="java" contentType="text/html; charset=UTF-8"
    
        pageEncoding="UTF-8"%>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    
    <html>
    
    <%
    
    //接收客户端传递过来的参数
    
    String username = request.getParameter("username");
    
    String password = request.getParameter("password");
    
    if(username == null || "".equals(username.trim())){
    
    request.setAttribute("error", "用户名不能为空");
    
     
    
    %>
    
    <jsp:forward page="login.jsp"></jsp:forward>
    
    <%
    
    }
    
    User user =  new User();
    
    user.setUsername(username);
    
    user.setPassword(password);
    
    UserDaoImpl userDao = new UserDaoImpl();
    
    try{
    
    if(userDao.load(username).getPassword()==password){
    
     
    
    %>
    
    <p>登陆成功!!</p><br>
    
    <a href="#">列表</a><br>
    
    <%
    
    }
    
    else{
    
    %>
    
    <p>登陆失败!!</p><br>
    
    <%
    
    }
    
    }catch(UserException e){
    
    %>
    
    <h2 style="color:red ; font-size:50px">发生错误 : <%=e.getMessage() %></h2>
    
    <%
    
    }
    
    %>
    
    </html>

    三.运行结果截图

     

    四.说明课堂测试未按时完成的原因

    难度太大,时间全部用在查资料中,虽然在查资料的过程中掌握了很多知识,但还是不能完整的做出来,只能借鉴同学做好的成品

    感觉到自己还有很多有不足的地方,所以我想每天都至少用一个半小时的时间用来编程序,查相关资资料,增强自己的的专业技能

  • 相关阅读:
    数据库基础+重置root密码
    Bug定级
    测试用例和测试方法
    测试基础
    HDOJ-1010 Tempter of the Bone(dfs)
    POJ
    HDU-2089 不要62 (数位DP)
    Happy!
    LOJ-1422 万圣节服装
    数字三角形(数塔问题)
  • 原文地址:https://www.cnblogs.com/wj1998/p/7881141.html
Copyright © 2011-2022 走看看