方法编写写

主页面

<%@ 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>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值