SSM相关JSP代码

jsp页面

userinfo.jsp
<%@ 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>
<html>
<head>
<meta charset="UTF-8">
<title>UserInfo</title>
<style type="text/css">
body{
	text-align: center;
}
</style>
</head>
<body>
	<form method="post" action="${pageContext.request.contextPath}/user/queryByName">
		<input type="text" name="uname" />
		<input type="submit" value="查询" />
		<a href="${pageContext.request.contextPath}/user/toAddUser">添加</a><br><br>
		<table border="1" style="margin: auto;width:500px">
			<tr>
				<th>编号</th>
				<th>姓名</th>
				<th>年龄</th>
				<th>操作</th>
			</tr>
			<c:forEach items="${ulist}" var="x">
				<tr>
					<td>${x.uid}</td>
					<td>${x.uname}</td>
					<td>${x.age}</td>
					<td>
						<a href="${pageContext.request.contextPath}/user/toUpdtUser?uid=${x.uid}">修改</a>
					<!-- <a href="${pageContext.request.contextPath}/user/delUser?uid=${x.uid}">删除</a> -->
						<a href="javascript:del(${x.uid})">删除</a>
					</td>
				</tr>
			</c:forEach>
		</table><br>
	</form>
	第${pageinfo.pageNum}/共${pageinfo.pages}<a href="${pageContext.request.contextPath}/user/getAllUser?pageNum=${pageinfo.prePage}">上一页</a>
	<c:forEach begin="1" end="${pageinfo.pages}" step="1" var="y">
		<a href="${pageContext.request.contextPath}/user/getAllUser?pageNum=${y}">${y}</a>
	</c:forEach>
	<a href="${pageContext.request.contextPath}/user/getAllUser?pageNum=${pageinfo.nextPage}">下一页</a>
</body>
<script>
	function del(uid) {
		if (window.confirm("确定删除?")) {
			console.log("delete");
			//window.open();
			window.location.href = "${pageContext.request.contextPath}/user/delUser?uid=" + uid;
		} else {
			console.log("no action");
		}
	}
</script>
</html>
update.jsp
<body>
	<h1>修改用户</h1>
	<form method="post" action="${pageContext.request.contextPath}/user/updtUser">
		编号:<input type="text" name="uid" value="${user.uid}" readonly="readonly"><br><br> 
		姓名:<input type="text" name="uname" value="${user.uname}"><br><br> 
		年龄:<input type="text" name="age" value="${user.age}"><br><br>
		<input type="submit" value="修改">
	</form>
</body>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

civilisation_an

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值