views.jsp

Posted Cool_001

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了views.jsp相关的知识,希望对你有一定的参考价值。

department

input

<title>部门新增或者修改</title>

<form action="/department/saveOrUpdate.do" method="post">
    <input type="hidden" name="id" value="${department.id}">
    <input type="text" name="name" placeholder="名称" value="${department.name}"><br/>
    <input type="text" name="sn" placeholder="缩写" value="${department.sn}"><br/>
    <input type="submit" value="提交">
</form>

list

<title>部门列表</title>
<script>
    function goPage(currentPage){
        document.getElementById("currentPage").value=currentPage;
        document.forms[0].submit();
    }
</script>

<a href="/department/input.do">新增</a>
<!-- 查询的表单 -->
<form action="/department/list.do" method="post">
    <input type="hidden" name="currentPage" id="currentPage" value="1"/>
</form>

<table width="800px" cellpadding="0" cellspacing="0" align="center" border="1px">
    <tr>
        <td>ID</td>
        <td>名称</td>
        <td>缩写</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${pageResult.data}" var="department">
        <tr>
            <td>${department.id}</td>
            <td>${department.name}</td>
            <td>${department.sn}</td>
            <td>
                <a href="/department/delete.do?id=${department.id}">删除</a>
                <a href="/department/input.do?id=${department.id}">修改</a>
            </td>
        </tr>
    </c:forEach>
    <tr align="center">
        <td colspan="9">
            <a href="javascript:goPage(1);">首页</a>
            <a href="javascript:goPage(${pageResult.prevPage});">上一页</a>
            <a href="javascript:goPage(${pageResult.nextPage});">下一页</a>
            <a href="javascript:goPage(${pageResult.totalPage});">尾页</a>
            当前:${pageResult.currentPage}/${pageResult.totalPage}
            总条数:${pageResult.totalCount}
        </td>
    </tr>
</table>

employee

input

<title>员工新增或者修改</title>

<form action="/employee/saveOrUpdate.do" method="post">
    <input type="hidden" name="id" value="${employee.id}">
    名称:<input type="text" name="name" placeholder="名称" value="${employee.name}"><br/>
    密码:<input type="text" name="password" placeholder="密码" value="${employee.password}"><br/>
    邮箱:<input type="text" name="email" placeholder="邮箱" value="${employee.email}"><br/>
    年龄:<input type="text" name="age" placeholder="年龄" value="${employee.age}"><br/>
    超管:<input type="text" name="admin" placeholder="超管" value="${employee.admin}"><br/>
    部门:<select name="dept.id">
        <c:forEach items="${departments}" var="department">
            <option value="${department.id}" <c:if test="${employee.dept.id == department.id}">selected</c:if> >${department.name}</option>
        </c:forEach>
    </select>
    <input type="submit" value="提交">
</form>

list

<title>员工列表</title>
<script>
    function goPage(currentPage){
        document.getElementById("currentPage").value=currentPage;
        document.forms[0].submit();
    }
</script>

<a href="/employee/input.do">新增</a>

<!-- 查询的表单 -->
<form action="/employee/list.do" method="post">
    <input type="hidden" name="currentPage" id="currentPage" value="1"/>
    关键字:<input type="text" name="keyword" value="${qo.keyword}"/>
    部门:<select name="deptId">
            <option value="-1">全部</option>
            <c:forEach items="${departments}" var="department">
                <option value="${department.id}" <c:if test="${qo.deptId == department.id}">selected</c:if> >${department.name}</option>
            </c:forEach>
    </select>
    <input type="submit" value="查询"/>
</form>

<table width="800px" cellpadding="0" cellspacing="0" align="center" border="1px">
    <tr>
        <td>ID</td>
        <td>名称</td>
        <td>邮箱</td>
        <td>年龄</td>
        <td>超管</td>
        <td>部门</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${pageResult.data}" var="employee">
        <tr>
            <td>${employee.id}</td>
            <td>${employee.name}</td>
            <td>${employee.email}</td>
            <td>${employee.age}</td>
            <td>${employee.admin?"是":"否"}</td>
            <td>${employee.dept.name}</td>
            <td>
                <a href="/employee/delete.do?id=${employee.id}">删除</a>
                <a href="/employee/input.do?id=${employee.id}">修改</a>
            </td>
        </tr>
    </c:forEach>
    <tr align="center">
        <td colspan="9">
            <a href="javascript:goPage(1);">首页</a>
            <a href="javascript:goPage(${pageResult.prevPage});">上一页</a>
            <a href="javascript:goPage(${pageResult.nextPage});">下一页</a>
            <a href="javascript:goPage(${pageResult.totalPage});">尾页</a>
            当前:${pageResult.currentPage}/${pageResult.totalPage}
            总条数:${pageResult.totalCount}
        </td>
    </tr>
</table>

以上是关于views.jsp的主要内容,如果未能解决你的问题,请参考以下文章

VSCode自定义代码片段——CSS选择器

谷歌浏览器调试jsp 引入代码片段,如何调试代码片段中的js

片段和活动之间的核心区别是啥?哪些代码可以写成片段?

VSCode自定义代码片段——.vue文件的模板

VSCode自定义代码片段6——CSS选择器

VSCode自定义代码片段——声明函数