记录一些比较常用的简单jsp模板

记录一些比较常用的简单jsp模板

一:登录

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>登录页面</title>
  </head>
  <body>
  <form name="frmlogin" method="post" action="${pageContext.request.contextPath}/doLogin">
    用户名:<input name="username" type="text"/></br>
    密 码:<input name="password" type="password"/></br>
    <input name="resetbtn" type="reset" value="重置"/>
    <input name="loginbtn" type="submit" value="登录"/>
  </form>
  </body>
</html>

在这里插入图片描述

二:显示信息

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>客户管理</title>
</head>
<body>

<form name="frmsearch" action="${pageContext.request.contextPath}/docust?op=search" method="post">
    <input type="text" name="custname" value="${requestScope.condition.custname}">
    <input class="btnsearch" type="submit" value="查询">
</form>

<table>
    <tr>
        <th>编号</th>
        <th>客户名</th>
        <th>联系人</th>
        <th>电话</th>
        <th>邮箱</th>
        <th>操作</th>
    </tr>

    <c:forEach items="${requestScope.custs}" var="cust">
        <tr>
            <td>${cust.custid}</td>
            <td>${cust.custname}</td>
            <td>${cust.contacts}</td>
            <td>${cust.tel}</td>
            <td>${cust.email}</td>
            <td>
                <a href="${pageContext.request.contextPath}/docust?op=toedit&custid=${cust.custid}">修改</a>
                &nbsp;|&nbsp;
                <a href="${pageContext.request.contextPath}/docust?op=todel&custid=${cust.custid}">删除</a>
            </td>
        </tr>
    </c:forEach>

</table>
</body>
</html>

在这里插入图片描述

三:添加信息

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加客户</title>
</head>
<body>
<form name="frmadd" method="post" action="${pageContext.request.contextPath}/docust?op=doadd">
    客户名称:<input name="custname" type="text"/></br>
    联系人:<input name="contacts" type="text"/></br>
    邮箱:<input name="email" type="email"/></br>
    电话:<input name="tel" type="tel"/></br>
    <input name="resetbtn" type="reset" value="重置"/>
    <input name="addbtn" type="submit" value="添加"/>
</form>
</body>
</html>

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值