今天完成内容:
开发家庭小账本:页面
1.编写代码
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="a"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page import = "com.edu.entity.*" %>
<%@ page import = "java.util.List" %>
<%@ page import = "com.edu.dao.*" %>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://t.zoukankan.com/<%=path%> /resource/bs/js/jquery-1.11.1.js"></script> <!-- 引入jquery -->
<link rel="stylesheet" href="http://t.zoukankan.com/<%=path%>/resource/bs/css/bootstrap.css"> <!-- 引入bootstrap.css -->
<script src="http://t.zoukankan.com/<%=path%> /resource/bs/js/bootstrap.min.js"></script><!-- 引入bootstrap.min.js -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>信息显示</title>
<style type="text/css">
body{
background:url("./backs.jpg");
background-repeat:repeat;
background-size:1600px 800px;
background-position-center:100%;
}
</style>
<script language = "javascript">
function jump1(){
window.location.href = "http://t.zoukankan.com/Addused.jsp";
}
function jump2(){
window.location.href = "http://t.zoukankan.com/Updateused.jsp";
}
</script>
<style type="text/css">
table {
border: 1px solid black;
margin: 0 auto;
}
td{
150px;
border: 1px solid black;
text-align: center;
}
</style>
</head>
<body>
<%!
int i=0,e=0,sum=0;
%>
<%
Userdao dao = new Userdao();
List<User> list = dao.showAll();
request.setAttribute("list", list);
int i=0,e=0;
i = dao.IncomeSum();
e = dao.ExpendSum();
sum = i-e;
%>
<form action="/MoneyCount/Showservlet">
<table border="1">
<tr>
<td colspan="7" class="text-center"><h2>信息展示</h2></td>
</tr>
<tr>
<td>收支编号</td>
<td>收支人姓名</td>
<td>收支用途</td>
<td>收支状况</td>
<td>收支金额</td>
<td>收支日期</td>
<td>操作</td>
</tr>
<c:forEach items="${list}" var="user">
<tr>
<td>${user.id }</td>
<td>${user.username }</td>
<td>${user.userused }</td>
<td>${user.used }</td>
<td>${user.usermoney }</td>
<td><fmt:formatDate value="${user.usedate}" type="both"/></td>
<td><a href="http://t.zoukankan.com/Deleteservlet?id=${user.id}" onclick="if(confirm('是否确定删除?')==false)return false">删除</a>
||<a href="http://t.zoukankan.com/Updateservlet?id=${user.id}">修改</a></td>
</tr>
</c:forEach>
<tr>
<td><input type="button" value="添加" onclick="jump1()">|<input type="button" value="返回" onclick="history.go(-1)"></td>
<td>支出总金额:</td>
<td><%=e %></td>
<td>收入总金额:</td>
<td><%=i %></td>
<td>总计:</td>
<td><%=sum %></td>
</tr>
<tr>
<td colspan="7" class="text-center">注:总计数值为正时,收入大于支出;总计数值为负值时,支出大于收入</td>
</tr>
</table>
</form>
</body>
</html>
遇到问题:
传值报错
明日目标:
学习Android studio的开发