码迷,mamicode.com
首页 > 其他好文 > 详细

软工概论第一周动手动脑

时间:2017-11-22 22:02:25      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:ror   cli   str   span   user   als   资料   http   ons   

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

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>

三.运行结果截图

 技术分享图片

技术分享图片

技术分享图片

技术分享图片

 

 

 

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

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

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

软工概论第一周动手动脑

标签:ror   cli   str   span   user   als   资料   http   ons   

原文地址:http://www.cnblogs.com/wj1998/p/7881141.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!