主页面
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="${pageContext.request.contextPath}/findAll" method="post">
<p>
所属项目
<select name="projectid">
<option value=''>--全部项目--</option>
<c:forEach items="${zhcx}" var="z">
<option value="${z.projectid}">${z.projectname}</option>
</c:forEach>
</select>
任务内容<input type="text" name="content">
任务状态
<input type="radio" name="taskstate" value="1">未完成
<input type="radio" name="taskstate" value="2">已完成
<input type="radio" name="taskstate" value="" checked="checked">全部
<input type="submit" value="查询">
<a href="${pageContext.request.contextPath}/xzym">添加</a>
</p>
<table border="2px">
<tr bgcolor="red">
<th>所属项目</th>
<th>任务优先级</th>
<th>任务内容</th>
<th>任务添加时间</th>
<th>任务状态</th>
<th>任务完成时间</th>
<th>操作</th>
</tr>
<c:forEach items="${taskList}" var="t">
<tr>
<td>${t.projectname}</td>
<td>
<c:if test="${t.taskpriority==1}">高</c:if>
<c:if test="${t.taskpriority==2}">中</c:if>
<c:if test="${t.taskpriority==3}">低</c:if>
</td>
<td>${t.content }</td>
<td>${t.ADDTIME}</td>
<td>${t.taskstate==1?'未完成':'已完成'}</td>
<td>${t.finishedtime }</td>
<td><a href="${pageContext.request.contextPath}/del/${t.taskid}" οnclick="return confirm('真的要删除吗')">删除</a>
<a href="${pageContext.request.contextPath}/upd/${t.taskid}" οnclick="return confirm('完成了吗')">${t.finishedtime==null?'完成任务':''}</a>
</td>
</tr>
</c:forEach>
</table>
</form>
</body>
</html>
//新增页面
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="${pageContext.request.contextPath}/add" method="post">
<table border="1px">
<tr>
<td colspan="2" align="center">添加任务</td>
</tr>
<tr>
<td>所属项目:</td>
<td><select name="projectid" id="projectid">
<option value=''>--全部项目--</option>
<c:forEach items="${zhcx}" var="z">
<option value="${z.projectid}">${z.projectname}</option>
</c:forEach>
</select>
</td>
</tr>
<tr>
<td>任务优先级:</td>
<td>
<input type="radio" name="taskpriority" value="1">高
<input type="radio" name="taskpriority" value="2">中
<input type="radio" name="taskpriority" value="3">低
</td>
</tr>
<tr>
<td>任务内容:</td>
<td>
<textarea rows="10" cols="5" name="content" id="content"></textarea>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="添加">
<input type="button" οnclick="javascript:history.go(-1)" value="返回到主页">
</td>
</tr>
</table>
</form>
</body>
</html>