ssm整合JSP查询界面
来源:互联网 发布:谷歌娘语音软件 编辑:程序博客网 时间:2024/06/06 18:05
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>
<script type="text/javascript">
$(function(){
$("#selectAll").click(function(){
$("input[type=checkbox]:gt(0)").attr("checked","checked");
});
$("#deleteAll").click(function(){
var array=new Array();
$("input[type=checkbox]:gt(0):checked").each(function(){
array.push($(this).parent().next().text());
});
console.log(array);
location.href="${pageContext.request.contextPath}/user/batchDelete?ids="+array;
});
$("#getUserList").click(function(){
var name=$(this).prev().val();
if($("#name").val==null&&$("#name").val==''){
alert("ai");
location.href="${pageContext.request.contextPath}/user/getUserList?name"+name;
}else{
location.href="${pageContext.request.contextPath}/user/getUserList";
}
});
$("#import").click(function(){
var array=$("input[type=checkbox]:checked");
if(array.length==0){
alert("请选择您要导出的数据...");
}else{
var ids=new Array();
array.each(function(){
ids.push($(this).parent().next().text());
});
$.post("${pageContext.request.contextPath}/employee/queryByIds","ids="+ids,function(d){
if(d=="ok"){
alert("数据导入成功!");
}else{
alert("数据导入失败!");
}
location.reload();
},"json");
}
});
});
</script>
</head>
<body>
<div>
姓名:<input type="text" name="name" id="name"/><input type="button" value="查询" id="getUserList"/>
<input type="button" value="导出" id="import"/>
</div>
<table border="1" width="80%" bgcolor="palegreen">
<tr>
<th>选择</th>
<th>序号</th>
<th>姓名</th>
<th>薪资</th>
<th>职位</th>
<th>部门</th>
<th>操作</th>
</tr>
<c:forEach items="${requestScope.list }" var="e">
<tr>
<td><input type="checkbox"></td>
<td>${e.id }</td>
<td>${e.name }</td>
<td>${e.salary }</td>
<td>${e.position }</td>
<td>${e.department.name }</td>
<td><a href="${pageContext.request.contextPath }/user/selectdepart.do">添加</a> </td>
</tr>
</c:forEach>
</table>
<input type="button" value="批量删除" id="deleteAll"/>
</body>
</html>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>
<script type="text/javascript">
$(function(){
$("#selectAll").click(function(){
$("input[type=checkbox]:gt(0)").attr("checked","checked");
});
$("#deleteAll").click(function(){
var array=new Array();
$("input[type=checkbox]:gt(0):checked").each(function(){
array.push($(this).parent().next().text());
});
console.log(array);
location.href="${pageContext.request.contextPath}/user/batchDelete?ids="+array;
});
$("#getUserList").click(function(){
var name=$(this).prev().val();
if($("#name").val==null&&$("#name").val==''){
alert("ai");
location.href="${pageContext.request.contextPath}/user/getUserList?name"+name;
}else{
location.href="${pageContext.request.contextPath}/user/getUserList";
}
});
$("#import").click(function(){
var array=$("input[type=checkbox]:checked");
if(array.length==0){
alert("请选择您要导出的数据...");
}else{
var ids=new Array();
array.each(function(){
ids.push($(this).parent().next().text());
});
$.post("${pageContext.request.contextPath}/employee/queryByIds","ids="+ids,function(d){
if(d=="ok"){
alert("数据导入成功!");
}else{
alert("数据导入失败!");
}
location.reload();
},"json");
}
});
});
</script>
</head>
<body>
<div>
姓名:<input type="text" name="name" id="name"/><input type="button" value="查询" id="getUserList"/>
<input type="button" value="导出" id="import"/>
</div>
<table border="1" width="80%" bgcolor="palegreen">
<tr>
<th>选择</th>
<th>序号</th>
<th>姓名</th>
<th>薪资</th>
<th>职位</th>
<th>部门</th>
<th>操作</th>
</tr>
<c:forEach items="${requestScope.list }" var="e">
<tr>
<td><input type="checkbox"></td>
<td>${e.id }</td>
<td>${e.name }</td>
<td>${e.salary }</td>
<td>${e.position }</td>
<td>${e.department.name }</td>
<td><a href="${pageContext.request.contextPath }/user/selectdepart.do">添加</a> </td>
</tr>
</c:forEach>
</table>
<input type="button" value="批量删除" id="deleteAll"/>
</body>
</html>
阅读全文
2 0
- ssm整合JSP查询界面
- ssm整合jsp的添加界面
- ssm整合拦截器JSP界面
- SSM登录的JSP界面
- 多表连接查询-Jsp界面取值(SSM)备忘
- ssm项目整合solr索引查询
- SSM整合
- SSM整合
- SSM整合
- ssm整合
- SSM整合
- ssm整合
- ssm整合
- SSM整合
- SSM整合
- SSM整合
- SSM整合
- ssm整合
- Codeforces 439D Devu and his Brother【思维+三分查找】
- 回顾javaScript的面向对象继承
- java 8 Stream Collectors使用注意
- python脚本--用户密码登陆1
- 单例模式封装PDO链接数据库
- ssm整合JSP查询界面
- codeforces 567A Lineland Mail
- Arduino开发之Light Sensor
- 【OpenVswitch源码分析之二】架构
- 禁止复制
- 解决robotframework连接mysql数据库返回中文数据显示乱码
- 【Jmeter】时间变量参数
- webgl——实现物体描边效果
- 各种ESB产品比较