java多线程Thead.start()启动后没有进入run 10C

项目打包传到tomcat后,调用多线程的接口,Thead.start()后没有执行run方法,这是为啥,

6个回答

自定义Thread需要继承Tread类或实现runnable接口,请参考如下链接
https://blog.csdn.net/longshengguoji/article/details/41126119

ainiburuqusi
ainiburuqusi 回复jingguangquan: 上代码啊
一年多之前 回复
jingguangquan
jingjtjt 本地main中测过,没问题
一年多之前 回复

正常应该是会进去的,这个东西没有太多的幺蛾子。
最好的是用写log的方法确认一下,是不是真的没进去,还是说进去了之后发生异常线程崩溃了。
用log的方法,在可能出问题的地方把相应的变量打出来,看看哪儿的问题。

有可能程序出异常导致终止执行,搞个日志跟踪下

把代码贴出来吧,应该是有些小原因没注意到

貌似可能是异常处理没做好,所以导致没执行线程就抛出异常没法继续执行下去。

在你写Thead.start()的当前类 继承Thead类

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
dump thread 文件分析
## dump thread 文件分析 dump thead 出现大量如下线程,最后导致线程都不执行。请教一下出现这种问题怎么解决或下面的dump日志表示什么意思,问题原因是什么? 谢谢 ```java "mcloud-backend_30" daemon prio=10 tid=0x00002b6a100dd800 nid=0x5957 waiting on condition [0x00002b68ffbce000] java.lang.Thread.State: WAITING (parking) at sun.misc.Unsafe.park(Native Method) - parking to wait for <0x00000006c05a0088> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject) at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186) at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043) at java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:374) at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1068) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) ```
我的前端table的格式thead与tbody对不齐?
这是我的js代码。 ![图片说明](https://img-ask.csdn.net/upload/201911/22/1574404189_237687.png) 这是我的页面。 ![图片说明](https://img-ask.csdn.net/upload/201911/22/1574404214_251609.png) 这个完全没有对齐,这是怎么回事? 我又没有该任何的js代码,只是渲染页面数据后就出现对不齐的情况。 而且我之前和这些页面类似的页面都没有出问题,你看下面。 ![图片说明](https://img-ask.csdn.net/upload/201911/22/1574404358_627681.png)
ajax获取数据更新table以后,jquery.datatable的js效果失效了该怎么办呀QAQ?
用了jquery的模板表格,如果table里面放的是静态数据的话,选择展示多少条数据、搜索表格内容的功能都是正常的。 但用ajax从后台获取实际上的数据,append到tbody里面这样的形式后,就发现上面这些功能都失效了。 菜鸡学艺不精,网上的方法都试过了,都不行。 感觉好像是同步异步的问题,但不知道该怎么解决,求大佬指路QAQ。 这个是html: ``` <div class="table-responsive"> <table id="dataTable1" width="100%" class="table table-striped table-lightfont" style="font-size: 15pt"> <thead > <!-- 第二版结果展示 --> <tr> <!-- <th>ID</th> --> <th>站名</th> <th>设备名称</th> <th>电压等级</th> <th>采样时间</th> <th>相位</th> <th>最大过电压(kV)</th> </tr> <!-- ID,站名,设备名称,电压等级,采样时间,相位,最大电压值 --> </thead> <tfoot> <!-- 第二版结果展示 --> <tr> <!-- <th>ID</th> --> <th>站名</th> </th>设备名称</th> <th>电压等级</th> <th>采样时间</th> <th>相位</th> <th>最大过电压(kV)</th> </tr> </tfoot> <tbody id="searchBody"> </tbody> </table> </div> ``` 这个是js: ``` function search() { //alert($("#station").val()) var station = $("#station").val() var start_time = $("#start_time").val() //alert(start_time.toUpperCase) var end_time = $("#end_time").val() var start_hour = $("#start_hour").val() alert(start_time.toUpperCase) var end_hour = $("#end_hour").val() var level = $("#selectLevel").val() var flag = false; //标识,表示页面上数据还未处理完成 $.ajax({ type : "get", url : "observe/search", data : $("#searchForm").serialize(), success : function(data) { /*table = $('#dataTable1').DataTable( { retrieve: true, destroy:true, paging: false } );*/ //alert("sucess!") //var length=getJsonLength(data); console.log(data) var arrData = eval(data); //alert(data[0].sampdate) var searchBody = $("#searchBody"); $("#searchBody").html(""); //var dataTable1 = $("dataTable1"); //$("#dataTable1").html(""); //var bodyInfo=""; //var tableInfo=""; if (data) { for (var i = 0; i < arrData.length; i++) { //ID,站名,设备名称,电压等级,采样时间,相位,最大电压值 var row = “【不重要,略过】"; searchBody.append(row); //bodyInfo+=row; } flag=true; } else { alert("数据库故障或无数据!"); } } }); var loadFile; loadFile = setInterval(function() {//定时检测 if(flag) {//如果数据已经处理完毕 //loadAlljscssFile(); loadjscssfile('static/js/jquery-3.2.1.min.js', "js"); //加载你的js文件 loadjscssfile('static/bootstrap-3.3.7/css/bootstrap.min.css', "css"); //加载你的css文件 loadjscssfile('static/bootstrap-3.3.7/js/bootstrap.min.js', "js"); //加载你的js文件 loadjscssfile('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css', "css"); //加载你的js文件 loadjscssfile('bower_components/datatables.net/js/jquery.dataTables.min.js', "js"); //加载你的js文件 clearTimeout();//取消定时检测节省开销 } },50); } ```
利用angular做一个嵌套表格进行统计
![图片说明](https://img-ask.csdn.net/upload/201912/11/1576032602_261756.png) 1、表格是一个html页面 ``` <table id="orderTable " class=" tableHelper table table-striped table-condensed table-bordered table-hover"> <thead> <tr> <th>编号</th> <th>姓名</th> <th>注册时间</th> <th>功能有效期</th> <th>状态</th> <th> </th> <th> </th> </tr> </thead> …… </table> ``` 2、主要逻辑是写在controller里面 3、具体要实现的是通过传入一个时间,进行相应的月份或者日统计,这里就麻烦大佬教我写月统计(本人前端小白,第一次上手angular,希望有大佬能教)
python中的BeautifulSoup用.contents获取子标签
.contents说明文档中解释是list,我用soup.thead.tr.contents获取后的值为: l = [<th>时间</th>,<th>指标名称</th>] 当我读取它时好像执行的是pop操作这是为什么 rst = BeautifulSoup() rst.append(l[1]) print(len(l)) 输出为1,少了一个
在data最后一列加上删除和修改按钮,自己加了之后一直报数据项错误,麻烦大佬们帮下忙?
在data最后一列加上删除和修改按钮,自己加了之后一直报数据项错误,麻烦大佬帮下忙 ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>二十九师信息</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"> <script src="https://cdn.bootcss.com/datatables/1.10.16/js/jquery.dataTables.js"></script> <script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.html5.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script> <style> .content { margin: 50px auto; border: 1px solid #ccc; } .operation { margin: 10px; } .operation>button { margin: 10px; } #books_length { float: left; margin-left: 20px; } #books_filter { float: right; margin-right: 20px; } #books { margin: 5px; text-align: center; } .center-block { display: block; width: 21%; margin: auto; } </style> </head> <body> <section class="content"> <div class="btn-group operation"> <button id="btn_add" type="button" class="btn bg-primary"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增 </button> <button id="btn_edit" type="button" class="btn bg-info"> <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改 </button> <button id="btn_delete" type="button" class="btn btn-success"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除 </button> <button type="button" class="btn btn-primary" >导出Excel</button> </div> <!-- 添加模块 --> <div class="modal fade" id="addBook" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">添加信息</h4> </div> <div id="addBookModal" class="modal-body"> <div class="form-horizontal"> <div class="form-group"> <label for="bookName" class="col-sm-2 control-label">姓名:</label> <div class="col-sm-10"> <input class="form-control" id="bookName" type="text"> </div> </div> <div class="form-group"> <label for="bookAuthor" class="col-sm-2 control-label">性别:</label> <div class="col-sm-10"> <input class="form-control" id="bookAuthor" type="text"> </div> </div> <div class="form-group"> <label for="bookPrice" class="col-sm-2 control-label">家庭住址:*</label> <div class="col-sm-10"> <input class="form-control" id="bookPrice" type="text"> </div> </div> <div class="form-group"> <label for="bookPublish" class="col-sm-2 control-label">联系电话:</label> <div class="col-sm-10"> <input class="form-control" id="bookPublish" type="text"> </div> </div> <div class="form-group"> <label for="bookISBN" class="col-sm-2 control-label">备注:</label> <div class="col-sm-10"> <input class="form-control" id="bookISBN" type="text"> </div> </div> </div> </div> <div class="modal-footer"> <div class="center-block"> <button id="cancelAdd" type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="addBooksInfo" type="button" class="btn btn-success" data-dismiss="modal">保存</button> </div> </div> </div> </div> </div> <!-- 修改模块 --> <div class="modal fade" id="editBookInfo" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">修改信息</h4> </div> <div id="editBookModal" class="modal-body"> <div class="form-horizontal"> <div class="form-group"> <label for="editBookName" class="col-sm-2 control-label">姓名:</label> <div class="col-sm-10"> <input class="form-control" id="editBookName" type="text"> </div> </div> <div class="form-group"> <label for="editBookAuthor" class="col-sm-2 control-label">性别:</label> <div class="col-sm-10"> <input class="form-control" id="editBookAuthor" type="text"> </div> </div> <div class="form-group"> <label for="editBookPrice" class="col-sm-2 control-label">家庭住址:</label> <div class="col-sm-10"> <input class="form-control" id="editBookPrice" type="text"> </div> </div> <div class="form-group"> <label for="editBookPublish" class="col-sm-2 control-label">联系电话:</label> <div class="col-sm-10"> <input class="form-control" id="editBookPublish" type="text"> </div> </div> <div class="form-group"> <label for="editBookISBN" class="col-sm-2 control-label">备注:</label> <div class="col-sm-10"> <input class="form-control" id="editBookISBN" type="text"> </div> </div> </div> </div> <div class="modal-footer"> <div class="center-block"> <button id="cancelEdit" type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="saveEdit" type="button" class="btn btn-success" data-dismiss="modal">保存</button> </div> </div> </div> </div> </div> <!-- 删除模块 --> <div class="modal fade" id="deleteBook" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">确认要删除吗?</h4> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="delete" type="button" class="btn btn-danger" data-dismiss="modal">删除</button> </div> </div> </div> </div> <!-- 页面view层 --> <table id="books" class="table table-striped table-bordered row-border hover order-column" cellspacing="0" width="100%"> <thead> <tr> <th>序号</th> <th>姓名</th> <th>性别</th> <th>家庭住址</th> <th>联系电话</th> <th>备注</th> </tr> </thead> <tbody></tbody> </table> </section> </body> <script> var data = [['', '李云龙', '男', '三八六旅', '133435435', '厉害']] var titles = ['','姓名', '性别', '家庭住址', '联系电话', '备注'] $(function () { var table = $('#books').DataTable({ data: data, "pagingType": "full_numbers", "bSort": true, "language": { "sProcessing": "处理中...", "sLengthMenu": "显示 _MENU_ 项结果", "sZeroRecords": "没有匹配结果", "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项", "sInfoEmpty": "显示第 0 至 0 项结果,共 0 项", "sInfoFiltered": "(由 _MAX_ 项结果过滤)", "sInfoPostFix": "", "sSearch": "搜索:", "sUrl": "", "sEmptyTable": "表中数据为空", "sLoadingRecords": "载入中...", "sInfoThousands": ",", "oPaginate": { "sFirst": "首页", "sPrevious": "上页", "sNext": "下页", "sLast": "末页" }, "oAria": { "sSortAscending": ": 以升序排列此列", "sSortDescending": ": 以降序排列此列" } }, "buttons": [{ 'extend': 'excel', 'text': '导出为Excel统计表',//定义导出excel按钮的文字 'className': 'btn btn-primary', //按钮的class样式 'exportOptions': { 'modifier': { 'page': 'all' } } }], "columnDefs": [{ "searchable": true, "orderable": false, "targets": 0 }], "order": [[0, 'asc']], }); table.on('order.dt search.dt', function() { table.column(0, { search: 'applied', order: 'applied' }).nodes().each(function(cell, i) { cell.innerHTML = i + 1; }); }).draw(); $('#books tbody').on('click', 'tr', function () { if ( $(this).hasClass('selected') ) { $(this).removeClass('selected'); } else { table.$('tr.selected').removeClass('selected'); $(this).addClass('selected'); } }); $("#cancelAdd").on('click', function() { console.log('cancelAdd'); $("#addBookModal").find('input').val('') }) $("#addBooksInfo").on('click', function() { console.log('addBooksInfo'); if (data.length) { if ($("#addBookModal").find('input').val() !== '') { var bookbutton = $("#bookbutton").val() var bookName = $("#bookName").val() var bookAuthor = $("#bookAuthor").val() var bookPrice = $("#bookPrice").val() var bookPublish = $("#bookPublish").val() var bookISBN = $("#bookISBN").val() var addBookInfos = [].concat(bookName, bookAuthor, bookPrice, bookPublish, bookISBN); for (var i = 0; i < addBookInfos.length; i++) { if (addBookInfos[i] === '') { alert(titles[i] + '内容不能为空') } } table.row.add(['', bookName, bookAuthor, bookPrice, bookPublish, bookISBN]).draw(); $("#addBookModal").find('input').val('') } } else { alert('请输入内容') } }) $("#addBooksInfo").click(); $("#btn_add").click(function(){ console.log('add'); $("#addBook").modal() }); $('#btn_edit').click(function () { console.log('edit'); if (table.rows('.selected').data().length) { $("#editBookInfo").modal() var rowData = table.rows('.selected').data()[0]; var inputs = $("#editBookModal").find('input') for (var i = 0; i < inputs.length; i++) { $(inputs[i]).val(rowData[i + 1]) } } else { alert('请选择项目'); } }); $("#saveEdit").click(function() { var editBookName = $("#editBookName").val() var editBookAuthor = $("#editBookAuthor").val() var editBookPrice = $("#editBookPrice").val() var editBookPublish = $("#editBookPublish").val() var editBookISBN = $("#editBookISBN").val() var newRowData = [].concat(editBookName, editBookAuthor, editBookPrice, editBookPublish, editBookISBN); var tds = Array.prototype.slice.call($('.selected td')) for (var i = 0; i < newRowData.length; i++) { if (newRowData[i] !== '') { tds[i + 1].innerHTML = newRowData[i]; } else { alert(titles[i] + '内容不能为空') } } }) $("#cancelEdit").click(function() { console.log('cancelAdd'); $("#editBookModal").find('input').val('') }) $('#btn_delete').click(function () { if (table.rows('.selected').data().length) { $("#deleteBook").modal() } else { alert('请选择项目'); } }); $('#delete').click(function () { table.row('.selected').remove().draw(false); }); }) </script> </html> ``麻烦各位大佬帮下忙
这个datatable 的ajax 怎么写,麻烦大佬给填充一下
这里边的ajax请求不会写,麻烦大佬给填充一下 ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>二十九师信息</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css"> <script src="https://cdn.bootcss.com/datatables/1.10.16/js/jquery.dataTables.js"></script> <script src="https://cdn.datatables.net/buttons/1.5.1/js/buttons.html5.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script> <style> .content { margin: 50px auto; border: 1px solid #ccc; } .operation { margin: 10px; } .operation>button { margin: 10px; } #books_length { float: left; margin-left: 20px; } #books_filter { float: right; margin-right: 20px; } #books { margin: 5px; text-align: center; } .center-block { display: block; width: 21%; margin: auto; } </style> </head> <body> <section class="content"> <div class="btn-group operation"> <button id="btn_add" type="button" class="btn bg-primary"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增 </button> <button id="btn_edit" type="button" class="btn bg-info"> <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改 </button> <button id="btn_delete" type="button" class="btn btn-success"> <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除 </button> <button type="button" class="btn btn-primary" >导出Excel</button> </div> <!-- 添加模块 --> <div class="modal fade" id="addBook" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">添加信息</h4> </div> <div id="addBookModal" class="modal-body"> <div class="form-horizontal"> <div class="form-group"> <label for="bookName" class="col-sm-2 control-label">姓名:</label> <div class="col-sm-10"> <input class="form-control" id="bookName" type="text"> </div> </div> <div class="form-group"> <label for="bookAuthor" class="col-sm-2 control-label">性别:</label> <div class="col-sm-10"> <input class="form-control" id="bookAuthor" type="text"> </div> </div> <div class="form-group"> <label for="bookPrice" class="col-sm-2 control-label">家庭住址:*</label> <div class="col-sm-10"> <input class="form-control" id="bookPrice" type="text"> </div> </div> <div class="form-group"> <label for="bookPublish" class="col-sm-2 control-label">联系电话:</label> <div class="col-sm-10"> <input class="form-control" id="bookPublish" type="text"> </div> </div> <div class="form-group"> <label for="bookISBN" class="col-sm-2 control-label">备注:</label> <div class="col-sm-10"> <input class="form-control" id="bookISBN" type="text"> </div> </div> </div> </div> <div class="modal-footer"> <div class="center-block"> <button id="cancelAdd" type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="addBooksInfo" type="button" class="btn btn-success" data-dismiss="modal">保存</button> </div> </div> </div> </div> </div> <!-- 修改模块 --> <div class="modal fade" id="editBookInfo" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">修改信息</h4> </div> <div id="editBookModal" class="modal-body"> <div class="form-horizontal"> <div class="form-group"> <label for="editBookName" class="col-sm-2 control-label">姓名:</label> <div class="col-sm-10"> <input class="form-control" id="editBookName" type="text"> </div> </div> <div class="form-group"> <label for="editBookAuthor" class="col-sm-2 control-label">性别:</label> <div class="col-sm-10"> <input class="form-control" id="editBookAuthor" type="text"> </div> </div> <div class="form-group"> <label for="editBookPrice" class="col-sm-2 control-label">家庭住址:</label> <div class="col-sm-10"> <input class="form-control" id="editBookPrice" type="text"> </div> </div> <div class="form-group"> <label for="editBookPublish" class="col-sm-2 control-label">联系电话:</label> <div class="col-sm-10"> <input class="form-control" id="editBookPublish" type="text"> </div> </div> <div class="form-group"> <label for="editBookISBN" class="col-sm-2 control-label">备注:</label> <div class="col-sm-10"> <input class="form-control" id="editBookISBN" type="text"> </div> </div> </div> </div> <div class="modal-footer"> <div class="center-block"> <button id="cancelEdit" type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="saveEdit" type="button" class="btn btn-success" data-dismiss="modal">保存</button> </div> </div> </div> </div> </div> <!-- 删除模块 --> <div class="modal fade" id="deleteBook" role="dialog"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">确认要删除吗?</h4> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> <button id="delete" type="button" class="btn btn-danger" data-dismiss="modal">删除</button> </div> </div> </div> </div> <!-- 页面view层 --> <table id="books" class="table table-striped table-bordered row-border hover order-column" cellspacing="0" width="100%"> <thead> <tr> <th>序号</th> <th>姓名</th> <th>性别</th> <th>家庭住址</th> <th>联系电话</th> <th>备注</th> </tr> </thead> <tbody></tbody> </table> </section> </body> <script> var data = [['', '李云龙', '男', '三八六旅', '133435435', '厉害']] var titles = ['','姓名', '性别', '家庭住址', '联系电话', '备注'] $(function () { var table = $('#books').DataTable({ data: data, "pagingType": "full_numbers", "bSort": true, "language": { "sProcessing": "处理中...", "sLengthMenu": "显示 _MENU_ 项结果", "sZeroRecords": "没有匹配结果", "sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项", "sInfoEmpty": "显示第 0 至 0 项结果,共 0 项", "sInfoFiltered": "(由 _MAX_ 项结果过滤)", "sInfoPostFix": "", "sSearch": "搜索:", "sUrl": "", "sEmptyTable": "表中数据为空", "sLoadingRecords": "载入中...", "sInfoThousands": ",", "oPaginate": { "sFirst": "首页", "sPrevious": "上页", "sNext": "下页", "sLast": "末页" }, "oAria": { "sSortAscending": ": 以升序排列此列", "sSortDescending": ": 以降序排列此列" } }, "buttons": [{ 'extend': 'excel', 'text': '导出为Excel统计表',//定义导出excel按钮的文字 'className': 'btn btn-primary', //按钮的class样式 'exportOptions': { 'modifier': { 'page': 'all' } } }], "columnDefs": [{ "searchable": true, "orderable": false, "targets": 0 }], "order": [[0, 'asc']], }); table.on('order.dt search.dt', function() { table.column(0, { search: 'applied', order: 'applied' }).nodes().each(function(cell, i) { cell.innerHTML = i + 1; }); }).draw(); $('#books tbody').on('click', 'tr', function () { if ( $(this).hasClass('selected') ) { $(this).removeClass('selected'); } else { table.$('tr.selected').removeClass('selected'); $(this).addClass('selected'); } }); $("#cancelAdd").on('click', function() { console.log('cancelAdd'); $("#addBookModal").find('input').val('') }) $("#addBooksInfo").on('click', function() { console.log('addBooksInfo'); if (data.length) { if ($("#addBookModal").find('input').val() !== '') { var bookbutton = $("#bookbutton").val() var bookName = $("#bookName").val() var bookAuthor = $("#bookAuthor").val() var bookPrice = $("#bookPrice").val() var bookPublish = $("#bookPublish").val() var bookISBN = $("#bookISBN").val() var addBookInfos = [].concat(bookName, bookAuthor, bookPrice, bookPublish, bookISBN); for (var i = 0; i < addBookInfos.length; i++) { if (addBookInfos[i] === '') { alert(titles[i] + '内容不能为空') } } table.row.add(['', bookName, bookAuthor, bookPrice, bookPublish, bookISBN]).draw(); $("#addBookModal").find('input').val('') } } else { alert('请输入内容') } }) $("#addBooksInfo").click(); $("#btn_add").click(function(){ console.log('add'); $("#addBook").modal() }); $('#btn_edit').click(function () { console.log('edit'); if (table.rows('.selected').data().length) { $("#editBookInfo").modal() var rowData = table.rows('.selected').data()[0]; var inputs = $("#editBookModal").find('input') for (var i = 0; i < inputs.length; i++) { $(inputs[i]).val(rowData[i + 1]) } } else { alert('请选择项目'); } }); $("#saveEdit").click(function() { var editBookName = $("#editBookName").val() var editBookAuthor = $("#editBookAuthor").val() var editBookPrice = $("#editBookPrice").val() var editBookPublish = $("#editBookPublish").val() var editBookISBN = $("#editBookISBN").val() var newRowData = [].concat(editBookName, editBookAuthor, editBookPrice, editBookPublish, editBookISBN); var tds = Array.prototype.slice.call($('.selected td')) for (var i = 0; i < newRowData.length; i++) { if (newRowData[i] !== '') { tds[i + 1].innerHTML = newRowData[i]; } else { alert(titles[i] + '内容不能为空') } } }) $("#cancelEdit").click(function() { console.log('cancelAdd'); $("#editBookModal").find('input').val('') }) $('#btn_delete').click(function () { if (table.rows('.selected').data().length) { $("#deleteBook").modal() } else { alert('请选择项目'); } }); $('#delete').click(function () { table.row('.selected').remove().draw(false); }); }) </script> </html> ```
求助!!SpringBoot+X-admin 动态表格页面无法显示
其他页面都显示正常,带动态表格的页面都出不来 页面代码 ``` <!DOCTYPE html> <html class="x-admin-sm"> <head> <meta charset="UTF-8"> <title>欢迎页面-X-admin2.2</title> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" /> <link rel="stylesheet" href="./css/font.css"> <link rel="stylesheet" href="./css/xadmin.css"> <script src="./lib/layui/layui.js" charset="utf-8"></script> <script type="text/javascript" src="./js/xadmin.js"></script> <!--[if lt IE 9]> <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script> <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="x-nav"> <span class="layui-breadcrumb"> <a href="">首页</a> <a href="">演示</a> <a> <cite>导航元素</cite></a> </span> <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新"> <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a> </div> <div class="layui-fluid"> <div class="layui-row layui-col-space15"> <div class="layui-col-md12"> <div class="layui-card"> <div class="layui-card-body "> <form class="layui-form layui-col-space5"> <div class="layui-inline layui-show-xs-block"> <input class="layui-input" autocomplete="off" placeholder="开始日" name="start" id="start"> </div> <div class="layui-inline layui-show-xs-block"> <input class="layui-input" autocomplete="off" placeholder="截止日" name="end" id="end"> </div> <div class="layui-inline layui-show-xs-block"> <input type="text" name="username" placeholder="请输入用户名" autocomplete="off" class="layui-input"> </div> <div class="layui-inline layui-show-xs-block"> <button class="layui-btn" lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button> </div> </form> </div> <div class="layui-card-header"> <button class="layui-btn layui-btn-danger" onclick="delAll()"><i class="layui-icon"></i>批量删除</button> <button class="layui-btn" onclick="xadmin.open('添加用户','./member-add.html',600,400)"><i class="layui-icon"></i>添加</button> </div> <div class="layui-card-body "> <table class="layui-table layui-form"> <thead> <tr> <th> <input type="checkbox" name="" lay-skin="primary"> </th> <th>ID</th> <th>用户名</th> <th>性别</th> <th>手机</th> <th>地址</th> <th>状态</th> <th>操作</th></tr> </thead> <tbody> <tr> <td> <input type="checkbox" name="" lay-skin="primary"> </td> <td>1</td> <td>小明</td> <td>男</td> <td>13000000000</td> <td>北京市 海淀区</td> <td class="td-status"> <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td> <td class="td-manage"> <a onclick="member_stop(this,'10001')" href="javascript:;" title="启用"> <i class="layui-icon">&#xe601;</i> </a> <a title="编辑" onclick="xadmin.open('编辑','member-edit.html',600,400)" href="javascript:;"> <i class="layui-icon">&#xe642;</i> </a> <a onclick="xadmin.open('修改密码','member-password.html',600,400)" title="修改密码" href="javascript:;"> <i class="layui-icon">&#xe631;</i> </a> <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;"> <i class="layui-icon">&#xe640;</i> </a> </td> </tr> <tr> <td> <input type="checkbox" name="" lay-skin="primary"> </td> <td>1</td> <td>小明</td> <td>男</td> <td>13000000000</td> <td>北京市 海淀区</td> <td class="td-status"> <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td> <td class="td-manage"> <a onclick="member_stop(this,'10001')" href="javascript:;" title="启用"> <i class="layui-icon">&#xe601;</i> </a> <a title="编辑" onclick="xadmin.open('编辑','member-edit.html',600,400)" href="javascript:;"> <i class="layui-icon">&#xe642;</i> </a> <a onclick="xadmin.open('修改密码','member-password.html',600,400)" title="修改密码" href="javascript:;"> <i class="layui-icon">&#xe631;</i> </a> <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;"> <i class="layui-icon">&#xe640;</i> </a> </td> </tr> <tr> <td> <input type="checkbox" name="" lay-skin="primary"> </td> <td>1</td> <td>小明</td> <td>男</td> <td>13000000000</td> <td>北京市 海淀区</td> <td class="td-status"> <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td> <td class="td-manage"> <a onclick="member_stop(this,'10001')" href="javascript:;" title="启用"> <i class="layui-icon">&#xe601;</i> </a> <a title="编辑" onclick="xadmin.open('编辑','member-edit.html',600,400)" href="javascript:;"> <i class="layui-icon">&#xe642;</i> </a> <a onclick="xadmin.open('修改密码','member-password.html',600,400)" title="修改密码" href="javascript:;"> <i class="layui-icon">&#xe631;</i> </a> <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;"> <i class="layui-icon">&#xe640;</i> </a> </td> </tr> <tr> <td> <input type="checkbox" name="" lay-skin="primary"> </td> <td>1</td> <td>小明</td> <td>男</td> <td>13000000000</td> <td>北京市 海淀区</td> <td class="td-status"> <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td> <td class="td-manage"> <a onclick="member_stop(this,'10001')" href="javascript:;" title="启用"> <i class="layui-icon">&#xe601;</i> </a> <a title="编辑" onclick="xadmin.open('编辑','member-edit.html',600,400)" href="javascript:;"> <i class="layui-icon">&#xe642;</i> </a> <a onclick="xadmin.open('修改密码','member-password.html',600,400)" title="修改密码" href="javascript:;"> <i class="layui-icon">&#xe631;</i> </a> <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;"> <i class="layui-icon">&#xe640;</i> </a> </td> </tr> <tr> <td> <input type="checkbox" name="" lay-skin="primary"> </td> <td>1</td> <td>小明</td> <td>男</td> <td>13000000000</td> <td>北京市 海淀区</td> <td class="td-status"> <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td> <td class="td-manage"> <a onclick="member_stop(this,'10001')" href="javascript:;" title="启用"> <i class="layui-icon">&#xe601;</i> </a> <a title="编辑" onclick="xadmin.open('编辑','member-edit.html',600,400)" href="javascript:;"> <i class="layui-icon">&#xe642;</i> </a> <a onclick="xadmin.open('修改密码','member-password.html',600,400)" title="修改密码" href="javascript:;"> <i class="layui-icon">&#xe631;</i> </a> <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;"> <i class="layui-icon">&#xe640;</i> </a> </td> </tr> <tr> <td> <input type="checkbox" name="" lay-skin="primary"> </td> <td>1</td> <td>小明</td> <td>男</td> <td>13000000000</td> <td>北京市 海淀区</td> <td class="td-status"> <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td> <td class="td-manage"> <a onclick="member_stop(this,'10001')" href="javascript:;" title="启用"> <i class="layui-icon">&#xe601;</i> </a> <a title="编辑" onclick="xadmin.open('编辑','member-edit.html',600,400)" href="javascript:;"> <i class="layui-icon">&#xe642;</i> </a> <a onclick="xadmin.open('修改密码','member-password.html',600,400)" title="修改密码" href="javascript:;"> <i class="layui-icon">&#xe631;</i> </a> <a title="删除" onclick="member_del(this,'要删除的id')" href="javascript:;"> <i class="layui-icon">&#xe640;</i> </a> </td> </tr> </tbody> </table> </div> <div class="layui-card-body "> <div class="page"> <div> <a class="prev" href="">&lt;&lt;</a> <a class="num" href="">1</a> <span class="current">2</span> <a class="num" href="">3</a> <a class="num" href="">489</a> <a class="next" href="">&gt;&gt;</a> </div> </div> </div> </div> </div> </div> </div> </body> <script> layui.use(['laydate','form'], function(){ var laydate = layui.laydate; //执行一个laydate实例 laydate.render({ elem: '#start' //指定元素 }); //执行一个laydate实例 laydate.render({ elem: '#end' //指定元素 }); }); /*用户-停用*/ function member_stop(obj,id){ layer.confirm('确认要停用吗?',function(index){ if($(obj).attr('title')=='启用'){ //发异步把用户状态进行更改 $(obj).attr('title','停用') $(obj).find('i').html('&#xe62f;'); $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用'); layer.msg('已停用!',{icon: 5,time:1000}); }else{ $(obj).attr('title','启用') $(obj).find('i').html('&#xe601;'); $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用'); layer.msg('已启用!',{icon: 5,time:1000}); } }); } /*用户-删除*/ function member_del(obj,id){ layer.confirm('确认要删除吗?',function(index){ //发异步删除数据 $(obj).parents("tr").remove(); layer.msg('已删除!',{icon:1,time:1000}); }); } function delAll (argument) { var data = tableCheck.getData(); layer.confirm('确认要删除吗?'+data,function(index){ //捉到所有被选中的,发异步进行删除 layer.msg('删除成功', {icon: 1}); $(".layui-form-checked").not('.header').parents('tr').remove(); }); } </script> </html> ``` 报错信息: ``` 2019-04-24 09:39:55.725 ERROR 2736 --- [nio-8080-exec-8] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8080-exec-8] Exception processing template "client": An error happened during template parsing (template: "class path resource [templates/client.html]") org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/client.html]") at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:241) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) [thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) [thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:354) [thymeleaf-spring5-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:187) [thymeleaf-spring5-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1325) [spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1069) [spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1008) [spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) [spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) [spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866) [spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) [spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [tomcat-embed-websocket-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.29.jar:8.5.29] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_20] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_20] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.29.jar:8.5.29] at java.lang.Thread.run(Unknown Source) [na:1.8.0_20] Caused by: org.attoparser.ParseException: Attribute name cannot be null or empty at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:393) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.MarkupParser.parse(MarkupParser.java:257) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] ... 52 common frames omitted Caused by: java.lang.IllegalArgumentException: Attribute name cannot be null or empty at org.thymeleaf.engine.AttributeName.<init>(AttributeName.java:51) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.HTMLAttributeName.<init>(HTMLAttributeName.java:76) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.HTMLAttributeName.forName(HTMLAttributeName.java:63) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeNames.buildHTMLAttributeName(AttributeNames.java:292) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeNames.access$300(AttributeNames.java:37) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeNames$AttributeNamesRepository.storeAttribute(AttributeNames.java:693) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeNames$AttributeNamesRepository.getAttribute(AttributeNames.java:607) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeNames.forHTMLName(AttributeNames.java:480) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeDefinitions$AttributeDefinitionRepository.storeAttribute(AttributeDefinitions.java:788) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeDefinitions$AttributeDefinitionRepository.getAttribute(AttributeDefinitions.java:677) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeDefinitions.forHTMLName(AttributeDefinitions.java:405) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeDefinitions.forName(AttributeDefinitions.java:336) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleAttribute(TemplateHandlerAdapterMarkupHandler.java:492) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleAttribute(InlinedOutputExpressionMarkupHandler.java:360) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleAttribute(OutputExpressionInlinePreProcessorHandler.java:260) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleAttribute(InlinedOutputExpressionMarkupHandler.java:205) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.attoparser.HtmlElement.handleAttribute(HtmlElement.java:250) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.HtmlMarkupHandler.handleAttribute(HtmlMarkupHandler.java:529) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.MarkupEventProcessorHandler.handleAttribute(MarkupEventProcessorHandler.java:593) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.ParsingAttributeSequenceUtil.parseAttributeSequence(ParsingAttributeSequenceUtil.java:220) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.ParsingElementMarkupUtil.parseOpenElement(ParsingElementMarkupUtil.java:153) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.MarkupParser.parseBuffer(MarkupParser.java:710) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:301) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] ... 54 common frames omitted 2019-04-24 09:39:55.726 ERROR 2736 --- [nio-8080-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/client.html]")] with root cause java.lang.IllegalArgumentException: Attribute name cannot be null or empty at org.thymeleaf.engine.AttributeName.<init>(AttributeName.java:51) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.HTMLAttributeName.<init>(HTMLAttributeName.java:76) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.HTMLAttributeName.forName(HTMLAttributeName.java:63) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeNames.buildHTMLAttributeName(AttributeNames.java:292) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeNames.access$300(AttributeNames.java:37) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeNames$AttributeNamesRepository.storeAttribute(AttributeNames.java:693) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeNames$AttributeNamesRepository.getAttribute(AttributeNames.java:607) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeNames.forHTMLName(AttributeNames.java:480) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeDefinitions$AttributeDefinitionRepository.storeAttribute(AttributeDefinitions.java:788) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeDefinitions$AttributeDefinitionRepository.getAttribute(AttributeDefinitions.java:677) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeDefinitions.forHTMLName(AttributeDefinitions.java:405) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.AttributeDefinitions.forName(AttributeDefinitions.java:336) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleAttribute(TemplateHandlerAdapterMarkupHandler.java:492) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleAttribute(InlinedOutputExpressionMarkupHandler.java:360) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleAttribute(OutputExpressionInlinePreProcessorHandler.java:260) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleAttribute(InlinedOutputExpressionMarkupHandler.java:205) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.attoparser.HtmlElement.handleAttribute(HtmlElement.java:250) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.HtmlMarkupHandler.handleAttribute(HtmlMarkupHandler.java:529) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.MarkupEventProcessorHandler.handleAttribute(MarkupEventProcessorHandler.java:593) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.ParsingAttributeSequenceUtil.parseAttributeSequence(ParsingAttributeSequenceUtil.java:220) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.ParsingElementMarkupUtil.parseOpenElement(ParsingElementMarkupUtil.java:153) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.MarkupParser.parseBuffer(MarkupParser.java:710) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:301) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.attoparser.MarkupParser.parse(MarkupParser.java:257) ~[attoparser-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) ~[thymeleaf-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:354) ~[thymeleaf-spring5-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:187) ~[thymeleaf-spring5-3.0.9.RELEASE.jar:3.0.9.RELEASE] at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1325) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1069) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1008) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) ~[spring-webmvc-5.0.5.RELEASE.jar:5.0.5.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-embed-core-8.5.29.jar:8.5.29] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.29.jar:8.5.29] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_20] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_20] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.29.jar:8.5.29] at java.lang.Thread.run(Unknown Source) [na:1.8.0_20] ```
Socket异步传输远程主机强迫关闭了一个现有的链接
class AsyncProgram { static Thread thead = null; static Thread theadclient = null; static int port = 12345; static Socket server = null; static Socket client = null; static int buffersize = 40960000; static void Main() { thead = new Thread(new ThreadStart(() => { IPEndPoint netPoint = new IPEndPoint(IPAddress.Any,port); server = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp); server.Bind(netPoint); server.Listen(10); theadclient.Start(); while (true) { server.BeginAccept(new AsyncCallback(AcceptCallBack),server); } })); thead.Start(); theadclient = new Thread(new ThreadStart(() => { IPEndPoint netpoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"),port); client = new Socket(AddressFamily.InterNetwork,SocketType.Stream,ProtocolType.Tcp); client.BeginConnect(netpoint, new AsyncCallback(ConnectCallBack), client); })); } static void AcceptCallBack(IAsyncResult ar) { Socket serve = ar.AsyncState as Socket; serve.EndAccept(ar); } static void sendSata(Socket client) { byte[] buffers = new byte[buffersize]; FileStream file = new FileStream(@"E:\temp\iTunes64Setup.exe", FileMode.Open); int readCount = file.Read(buffers, 0, buffersize); client.BeginSend(buffers, 0, readCount, 0, new AsyncCallback(SendCallBack), client); while (readCount > 0) { client.BeginSend(buffers, 0, readCount, 0, new AsyncCallback(SendCallBack), client); } file.Close(); client.Disconnect(false); client.Close(); } static void ConnectCallBack(IAsyncResult ar) { Socket client = ar.AsyncState as Socket; client.EndConnect(ar); sendSata(client); } static void SendCallBack(IAsyncResult ar) { Socket client = ar.AsyncState as Socket; client.EndSend(ar); } }
primeNG-table封装组件,外部ng-tamplate写好thead和tbody,组件内部用ng-container投射之后排序及列宽改变失效
``` 组件外 <app-stock-table> <ng-template #tableHeader> <tr> <th pSortableColumn="a" pResizableColumn>股票 <p-sortIcon field="a"></p-sortIcon> </th> .... </tr> </ng-template> <ng-template #tableBody let-item> <tr [pSelectableRow]="item" (dblclick)="viewDetail(item)"> <td>{{item}}</td> </tr> </ng-template> </<app-stock-table> 组件内 <p-table [value]="tableDatas" [rowHover]="true" [resizableColumns]="true" [scrollable]="true" [paginator]="true" [pageLinks]="10" [rows]="20" [lazy]="true" [totalRecords]="24"> <ng-template pTemplate="header"> <ng-container *ngTemplateOutlet="egoalBodyTrTdRef2"></ng-container> </ng-template> <ng-template pTemplate="body" let-item> <ng-container *ngTemplateOutlet="egoalBodyTrTdRef3,context: {$implicit: item }"></ng-container> </ng-template> </p-table> ``` 有哪位大神能解决pSortableColumn pResizableColumn急组件内部table排序、改变列宽失效的问题?
关于C#线程暂停的问题
做一个下载程序,在不同的时间段自动下载不同时间段更新的文件, 怎样让它下载完某个一个时间段的文件后暂停,等到下一个时间段在自动下载? 由于不同的时间段间隔比较大,而且根据网速的不同下载文件的速度也会不同, 比如早上6点开始下载,可能7点下载完也可能12点才下载完 ,下一个文件更新的时间段是中午12点,时间就不会太固定, 所以我觉得thead.sleep()不是个好方法,请问下还有其他的方法吗?
html打印分页时候table被分开后如何设置margin
![图片说明](https://img-ask.csdn.net/upload/201910/31/1572490883_68196.png) html打印分页的时候,table被分开,第二页的时候如何不顶着上边。每个页面都有header,除了第一页外header和thead重叠了。不能通过更改@page{margin-top},因为header也会跟着下降,除此之外有什么好的办法吗,浏览器只能用chrome
如何使用jq在点击表格某一行时,让此行之前的所有行都变色
假如我点击exercise1 中的set2,我怎么样才可以让set1 和set2同时改变背景颜色? 代码如下: ``` <!DOCTYPE html> <html> <body> <div> <!--exercise table here--> <table border="1"> <thead> <tr> <th>Exercise</th> <th>Sets</th> <th>Reps</th> <th>Kg</th> </tr> </thead> <tbody> <tr> <td rowspan="3" id="ex1">Exercise1</td> <td class="ex1set">1</td> <td>12</td> <td>0</td> </tr> <tr> <td class="ex1set">2</td> <td>12</td> <td>0</td> </tr> <tr> <td class="ex1set">3</td> <td>12</td> <td>0</td> </tr> <tr> <td rowspan="3" id="ex2">Exercise2</td> <td class="ex2set">1</td> <td>10</td> <td>10</td> </tr> <tr> <td class="ex2set">2</td> <td>10</td> <td>10</td> </tr> <tr> <td class="ex2set">3</td> <td>10</td> <td>10</td> </tr> </tbody> </table> </div> </body> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> <script> for (let i = 1; i <= 2; i++) { $("#ex" + i).click(function () { $(this).css("backgroundColor", "#99ffbb") }); $(".ex"+i+"set").each(function (j, n) { let len = $(".ex"+i+"set").length $(n).click(function () { if (j < len - 1) { $(n).css("backgroundColor", "#99ffbb") } else if (j >= len - 1) { $("#ex"+i).css("backgroundColor", "#99ffbb") } }) }); } </script> </html> ```
淘淘商城运行users.jsp页面出现400错误。
![图片说明](https://img-ask.csdn.net/upload/201909/12/1568267628_637428.png) 上面的是项目的的文件列表。 cn.itcast.usermanage.controller包 PageController.java文件代码 ``` package cn.itcast.usermanage.controller; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; /** * 通用的页面跳转逻辑 * * @author * */ @Controller @RequestMapping("page") public class PageController { /** * 具体的跳转页面逻辑 -- test4 * * @param pageName * @return 视图名 */ @RequestMapping(value = "{pageName}", method = RequestMethod.GET) public String toPage(@PathVariable("pageName") String pageName) { return pageName; } } ``` mybatis.xml代码 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <plugins> <!-- 分页助手 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql" /> <!-- 该参数默认为false --> <!-- 设置为true时,使用RowBounds分页会进行count查询 --> <property name="rowBoundsWithCount" value="true" /> </plugin> <!-- 通用mapper --> <plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor"> <!--主键自增回写方法,默认值MYSQL,详细说明请看文档 --> <property name="IDENTITY" value="MYSQL" /> <!--通用Mapper接口,多个通用接口用逗号隔开 --> <property name="mappers" value="com.github.abel533.mapper.Mapper" /> </plugin> </plugins> </configuration> ``` spring文件代码区 applicationContext-mybatis.xml文件代码区 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <plugins> <!-- 分页助手 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql" /> <!-- 该参数默认为false --> <!-- 设置为true时,使用RowBounds分页会进行count查询 --> <property name="rowBoundsWithCount" value="true" /> </plugin> <!-- 通用mapper --> <plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor"> <!--主键自增回写方法,默认值MYSQL,详细说明请看文档 --> <property name="IDENTITY" value="MYSQL" /> <!--通用Mapper接口,多个通用接口用逗号隔开 --> <property name="mappers" value="com.github.abel533.mapper.Mapper" /> </plugin> </plugins> </configuration> ``` applicationContext-transaction.xml代码区 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <plugins> <!-- 分页助手 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql" /> <!-- 该参数默认为false --> <!-- 设置为true时,使用RowBounds分页会进行count查询 --> <property name="rowBoundsWithCount" value="true" /> </plugin> <!-- 通用mapper --> <plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor"> <!--主键自增回写方法,默认值MYSQL,详细说明请看文档 --> <property name="IDENTITY" value="MYSQL" /> <!--通用Mapper接口,多个通用接口用逗号隔开 --> <property name="mappers" value="com.github.abel533.mapper.Mapper" /> </plugin> </plugins> </configuration> ``` applicationContext.xml代码区 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <plugins> <!-- 分页助手 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql" /> <!-- 该参数默认为false --> <!-- 设置为true时,使用RowBounds分页会进行count查询 --> <property name="rowBoundsWithCount" value="true" /> </plugin> <!-- 通用mapper --> <plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor"> <!--主键自增回写方法,默认值MYSQL,详细说明请看文档 --> <property name="IDENTITY" value="MYSQL" /> <!--通用Mapper接口,多个通用接口用逗号隔开 --> <property name="mappers" value="com.github.abel533.mapper.Mapper" /> </plugin> </plugins> </configuration> ``` itcast-usermanage-servlet.xml代码区 ``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <plugins> <!-- 分页助手 --> <plugin interceptor="com.github.pagehelper.PageHelper"> <property name="dialect" value="mysql" /> <!-- 该参数默认为false --> <!-- 设置为true时,使用RowBounds分页会进行count查询 --> <property name="rowBoundsWithCount" value="true" /> </plugin> <!-- 通用mapper --> <plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor"> <!--主键自增回写方法,默认值MYSQL,详细说明请看文档 --> <property name="IDENTITY" value="MYSQL" /> <!--通用Mapper接口,多个通用接口用逗号隔开 --> <property name="mappers" value="com.github.abel533.mapper.Mapper" /> </plugin> </plugins> </configuration> ``` web.xml文件 ``` <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <display-name>itcast-usermanage</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/applicationContext*.xml</param-value> </context-param> <!--Spring的ApplicationContext 载入 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 编码过滤器,以UTF8编码 --> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF8</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 解决PUT请求无法提交表单数据的问题 --> <filter> <filter-name>HttpMethodFilter</filter-name> <filter-class>org.springframework.web.filter.HttpPutFormContentFilter</filter-class> </filter> <filter-mapping> <filter-name>HttpMethodFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 将POST请求转化为DELETE或者是PUT 要用_method指定真正的请求方法 --> <filter> <filter-name>HiddenHttpMethodFilter</filter-name> <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class> </filter> <filter-mapping> <filter-name>HiddenHttpMethodFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 配置SpringMVC框架入口 --> <servlet> <servlet-name>itcast-usermanage</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/itcast-usermanage-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>itcast-usermanage</servlet-name> <!-- 可行:/、*.xxx、/xxx/* 不行:/* --> <url-pattern>/rest/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <!-- ________________________________ --> <context-param> <param-name>spring.profiles.active</param-name> <param-value>dev</param-value> </context-param> <context-param> <param-name>spring.profiles.default</param-name> <param-value>dev</param-value> </context-param> <context-param> <param-name>spring.liveBeansView.mbeanDomain</param-name> <param-value>dev</param-value> </context-param> <!-- ________________________________ --> </web-app> ``` 还有的就是,我的tomcat默认是localhost:8080 运行tomcat报错图片 ![图片说明](https://img-ask.csdn.net/upload/201909/12/1568267939_567846.png) 求大佬帮我看看那里出了问题,找了一天了。还是没找到那里有问题!! 一直是400错误! users.jsp代码 ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>会员管理系统</title> <link rel="stylesheet" type="text/css" href="/js/jquery-easyui-1.4/themes/default/easyui.css" /> <link rel="stylesheet" type="text/css" href="/js/jquery-easyui-1.4/themes/icon.css" /> <script type="text/javascript" src="/js/jquery-easyui-1.4/jquery.min.js"></script> <script type="text/javascript" src="/js/jquery-easyui-1.4/jquery.easyui.min.js"></script> <script type="text/javascript" src="/js/jquery-easyui-1.4/locale/easyui-lang-zh_CN.js"></script> <script type="text/javascript" src="/js/common.js"></script> </head> <body> <div> <table class="easyui-datagrid" id="userList" title="会员列表" data-options="singleSelect:false,collapsible:true,pagination:true,url:'/user/list',method:'post',pageSize:5,toolbar:toolbar,pageList:[2,5,10]"> <thead> <tr> <th data-options="field:'ck',checkbox:true"></th> <th data-options="field:'id',width:60">ID</th> <th data-options="field:'userName',width:200">用户名</th> <th data-options="field:'name',width:100">姓名</th> <th data-options="field:'age',width:100">年龄</th> <th data-options="field:'sex',width:80,align:'right',formatter:formatSet">性别</th> <th data-options="field:'birthday',width:80,align:'right',formatter:formatBirthday">出生日期</th> <th data-options="field:'created',width:130,align:'center',formatter:formatDate">创建日期</th> <th data-options="field:'updated',width:130,align:'center',formatter:formatDate">更新日期</th> </tr> </thead> </table> </div> <div id="userAdd" class="easyui-window" title="新增会员" data-options="modal:true,closed:true,iconCls:'icon-save',href:'/user/page/add'" style="width:800px;height:600px;padding:10px;"> The window content. </div> <script type="text/javascript"> function formatDate(val,row){ var now = new Date(val); return now.format("yyyy-MM-dd hh:mm:ss"); } function formatBirthday(val,row){ var now = new Date(val); return now.format("yyyy-MM-dd"); } function formatSet(val,row){ if(val == 1){ return "男"; }else if(val == 2){ return "女"; }else{ return "未知"; } } function getSelectionsIds(){ var userList = $("#userList"); var sels = userList.datagrid("getSelections"); var ids = []; for(var i in sels){ ids.push(sels[i].id); } ids = ids.join(","); return ids; } var toolbar = [{ text:'新增', iconCls:'icon-add', handler:function(){ $('#userAdd').window('open'); } },{ text:'编辑', iconCls:'icon-edit', handler:function(){ $.messager.alert('提示','该功能由学员自己实现!'); } },{ text:'删除', iconCls:'icon-cancel', handler:function(){ var ids = getSelectionsIds(); if(ids.length == 0){ $.messager.alert('提示','未选中用户!'); return ; } $.messager.confirm('确认','确定删除ID为 '+ids+' 的会员吗?',function(r){ if (r){ $.post("/user/delete",{'ids':ids}, function(data){ if(data.status == 200){ $.messager.alert('提示','删除会员成功!',undefined,function(){ $("#userList").datagrid("reload"); }); } }); } }); } },'-',{ text:'导出', iconCls:'icon-remove', handler:function(){ var optins = $("#userList").datagrid("getPager").data("pagination").options; var page = optins.pageNumber; var rows = optins.pageSize; $("<form>").attr({ "action":"/user/export/excel", "method":"POST" }).append("<input type='text' name='page' value='"+page+"'/>") .append("<input type='text' name='rows' value='"+rows+"'/>").submit(); } }]; </script> </body> </html> ``` ![图片说明](https://img-ask.csdn.net/upload/201909/16/1568593584_158545.png)
ssm+ajax查询数据库无反应
求好心哥哥帮忙,前面发了一次问题,不知道为什么没发布出来,再发一遍 先是前端的Admin.jsp代码 ``` <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <% 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> <title>管理员界面</title> <script type="text/javascript" charset="utf-8"> $("#thisList").click(function(){ $.ajax({ type:"POST", url:"/returnMap", error:function(){ alert("error!--说明服务器返回失败"); }, dataType:"json", success:function(data){ $("#resultTable").empty(); var thisListValueStr=""; console.log(data.length+"条数据"); for(var i=0;i<data.length;i++){ var caseList=dada[i]; thisListValueStr="<tr><td>"+caseList.user_id+"</td><td>"+caseList.username+"</td><td>"+caseList.password+"</td></tr>"; $("#resultTable").append(thisListValueStr); thisListValueStr=""; } } }); }); </script> </head> <body> <button id="thisList" class="btn btn-default">获取数据</button> <table class="table"> <thead> <tr> <th>user_id</th> <th>username</th> <th>password</th> </tr> </thead > <tbody id="resultTable"> </tbody> </table> </body> </html> ``` 然后是controller层 ``` @RequestMapping(value="/returnMap",produces="text/heml;charset=UTF-8;") @ResponseBody public String returnMap(){ Map map1 = new HashMap(); map1.put("user_id","1001"); map1.put("username","李俊成"); map1.put("password","男"); Map map2 = new HashMap(); map2.put("user_id","1002"); map2.put("username","伍天秀"); map2.put("password","女"); String json=JSONArray.toJSONString(map1); System.out.println(json); return json; } ``` 这也是从网上抄的一段代码,但是用tomcat运行后可以进入界面但是点击按钮没有任何反应,controller层的方法也没有调用,昨天刚接触的ajax所以对这个不了解 我的目标是点击这个按钮,可以不刷新界面然后从我数据库的user表查询并返回出所有信息,然后可以对信息进行增删改操作,当然现在没有涉及到数据库都出错了。。 有没有老哥能指点一下迷津我哪里写错了,或者有别的方法能达到我这个目的的,小弟感激不尽,在线等
jsp罗列多个list怎样分页
``` ```后台查不同的表生成多个list,同时返回到jsp 去共同的几个属性展示,怎样实现分页。 <table class='table table-hover' width="100%" align="center" > <thead> <tr> <th class="text-center text-nowrap">船舶识别号</th> <th class="text-center text-nowrap">船舶IMO号</th> <th class="text-center text-nowrap">中文船名</th> <th class="text-center text-nowrap">英文船名</th> <th class="text-center text-nowrap">船舶国籍</th> <th class="text-center text-nowrap">船舶登记号</th> <th class="text-center text-nowrap">初次登记号</th> <th class="text-center text-nowrap">船舶种类</th> <th class="text-center text-nowrap">操作</th> </tr> </thead> <tbody> <s:iterator value="shipPoList" id="data" > <tr> <td class="text-center text-nowrap"><s:property value="ship_id"/> </td> <td class="text-center text-nowrap"><s:property value="ship_imo"/></td> <td class="text-center text-nowrap"><s:property value="ship_name_cn"/></td> <td class="text-center text-nowrap"><s:property value="ship_name_en"/></td> <td class="text-center text-nowrap">中国</td> <td class="text-center text-nowrap"><s:property value="ship_reg_no"/></td> <td class="text-center text-nowrap"><s:property value="ship_firstreg_no"/></td> <td class="text-center text-nowrap"> <s:if test='ship_type_code=="1001"'><paramc:display type="tagManningshipCertCateYc" property="ship_type_code" name="data" /></s:if> <s:else><paramc:display type="tagManningshipCertCate" property="ship_type_code" name="data" /></s:else> </td> <td class="text-center text-nowrap"> <input type="button" class="btn btn-primary" value="选&nbsp;&nbsp;择" onclick=" toQueryShipInfo( '<s:property value="ship_id"/>','<s:property value="ship_type_code"/>','<s:property value="ship_name_cn"/>','<s:property value="ship_grosston"/>' ,'<s:property value="ship_imo"/>','<s:property value="remark"/>', '<s:property value="regport_code"/>' ,'<s:property value="ship_engine_power"/>','<s:property value="sailingarea_code"/>','125')"/> </td> </tr> </s:iterator> <s:iterator value="shipInfoPoList" id="data" > <tr> <td class="text-center text-nowrap"><s:property value="ship_id"/> </td> <td class="text-center text-nowrap"><s:property value="imo_no"/></td> <td class="text-center text-nowrap"><s:property value="ship_name_cn"/></td> <td class="text-center text-nowrap"><s:property value="ship_name_en"/></td> <td class="text-center text-nowrap"><paramc:display type="tagGj" property="ship_nation" name="data" /></td> <td class="text-center text-nowrap"><s:property value="ship_regi_no"/></td> <td class="text-center text-nowrap"><s:property value="ship_firstreg_no"/></td> <td class="text-center text-nowrap"> <s:if test='ship_class_code=="1001"'><paramc:display type="tagManningshipCertCateYc" property="ship_class_code" name="data" /></s:if> <s:else><paramc:display type="tagManningshipCertCate" property="ship_class_code" name="data" /></s:else> </td> <td class="text-center text-nowrap"> <input type="button" class="btn btn-primary" value="选&nbsp;&nbsp;择" onclick="toQueryShipInfo( '<s:property value="ship_id"/>','<s:property value="ship_class_code"/>','<s:property value="ship_name_cn"/>','<s:property value="ship_grosston"/>' ,'<s:property value="imo_no"/>','<s:property value="remark"/>','<s:property value="org_code"/>' ,'<s:property value="ship_engine_power"/>','15','<s:property value="ship_nation"/>')"/> </td> </tr> </s:iterator> <s:iterator value="servMannshipInfoPoList" id="data" > <tr> <td class="text-center text-nowrap"><s:property value="ship_id"/> </td> <td class="text-center text-nowrap"><s:property value="imo_no"/></td> <td class="text-center text-nowrap"><s:property value="ship_name_cn"/></td> <td class="text-center text-nowrap"><s:property value="ship_name_en"/></td> <td class="text-center text-nowrap"><paramc:display type="tagGj" property="ship_nation" name="data" /></td> <td class="text-center text-nowrap"><s:property value="ship_regi_no"/></td> <td class="text-center text-nowrap"><s:property value="ship_firstreg_no"/></td> <td class="text-center text-nowrap"> <s:if test='ship_class_code=="1001"'><paramc:display type="tagManningshipCertCateYc" property="ship_class_code" name="data" /></s:if> <s:else><paramc:display type="tagManningshipCertCate" property="ship_class_code" name="data" /></s:else> </td> <td class="text-center text-nowrap"> <input type="button" class="btn btn-primary" value="选&nbsp;&nbsp;择" onclick="toQueryShipInfo( '<s:property value="ship_id"/>','<s:property value="ship_class_code"/>','<s:property value="ship_name_cn"/>','<s:property value="ship_grosston"/>' ,'<s:property value="imo_no"/>','<s:property value="remark"/>','<s:property value="report_org"/>' ,'<s:property value="ship_engine_power"/>','15','<s:property value="ship_nation"/>')"/> </td> </tr> </s:iterator> <s:if test='query_flag=="1"'> <tr align="left"> <td colspan="6"> <s:if test='shipPo.alter_flag=="0"'> <font>未查询到相应的见习船舶信息,请联系直属海事局进行见习船舶维护!</font> </s:if> <s:else> <font>未查询到相应的见习船舶信息!</font> </s:else> </td> </tr> </s:if> </tbody> </table>
Jquery DataTable服务端获取draw,start和length参数的值为null
前端代码: <table id="dtable" class="display"> <thead> <tr> <th>姓名</th> <th>编号</th> </tr> </thead> </table> <scripts type="text/javascript"> $(document).ready(function(){ $("#dtable").dataTable({ "serverSide":true, "ajax":{ "url":"/Approval/GetApprovalFormList", type":post }, "columns":[ {"data":"Name"}, {"data":"ID"} ] }) }) </scripts> 服务端代码: public JsonResult GetApprovalFormList() { string start=this.Request["start"]; string length=this.Request["end"]; }
easyui-datagrid 的load,loadData到底怎么用?感觉怎么用都不显示数据呢?
大哥们帮忙看看,下面是jsp代码 ``` <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!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=UTF-8"> <link rel="stylesheet" type="text/css" href="../plugins/easyui/themes/bootstrap/easyui.css"/> <link rel="stylesheet" type="text/css" href="../plugins/easyui/themes/icon.css"/> <link rel="stylesheet" type="text/css" href="../plugins/easyui/themes/color.css"/> <link rel="stylesheet" type="text/css" href="../plugins/easyui/demo/demo.css"/> <script type="text/javascript" src="../plugins/easyui/jquery.min.js"></script> <script type="text/javascript" src="../plugins/easyui/jquery.easyui.min.js"></script> <script type="text/javascript" src="../plugins/easyui/local/easyui-lang-zh_CN.js"></script> <style type="text/css"> </style> </head> <body> <table id='grid' class='easyui-datagrid' style='width:1100px;height:500px' title='用户列表' iconCls='icon-table' rownumbers='true' fitColumns='true' singleSelect='true' toolbar='#toolbar' > <thead> <tr> <th field='id' width='50' align='center'>id</th> <th field='name' width='70'align='center'>name</th> </tr> </thead> </table> </body> <script type="text/javascript"> var obj = {"total":2,"rows":[{id:"1",name:"一"},{id:"2",name:"二"}]}; $('#grid').datagrid('loadData',obj); </script> </html> ``` 使用load也不显示出来,不知道该怎么做了
struts2 装入包含检查是否登录的拦截器锥后,.jsp_Service()出现异常
我设置检查用户是否登录的包后,所有需要加载数据的页面出现是空白页面 2014-6-8 1:07:53 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException at org.apache.jsp.user.deleteuser_jsp._jspService(deleteuser_jsp.java:185) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at crm.filter.EncodingFilter.doFilter(EncodingFilter.java:17) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:88) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) struts.xml <?xml version="1.0" encoding="GBK"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <!--指定Spring框架的自动装配模式 --> <constant name="struts.objectFactory.spring.autoWrite " value="name"></constant> <constant name="struts.i18.encoding" value="GBK"></constant> <package name="common" namespace="/" extends="struts-default"> <action name="login" class="crm.web.struts.action.LoginAction"> <result name="success">/index.jsp</result> <result name="fail">/error.jsp</result> <result name="input">/user/login.jsp</result> </action> </package> <package name="struts" namespace="/" extends="struts-default"> <!-- 设置该包的默认拦截器 --> <interceptors> <interceptor name="loginInterceptor" class="crm.web.interceptor.LoginInterceptor"/> <interceptor name="authorityInterceptor" class="crm.web.interceptor.AuthorityInterceptor"/> <interceptor-stack name="myDefaultInterceptorStack"> <interceptor-ref name="loginInterceptor"/> <interceptor-ref name="defaultStack"/> </interceptor-stack> </interceptors> <default-interceptor-ref name="myDefaultInterceptorStack"/> <global-results> <result name="login" type="redirect">/user/login.jsp</result> </global-results> <action name="cancellation" class="crm.web.struts.action.CancellationAction"> <result name="success" type="redirect">/user/login.jsp</result> <result name="error" type="redirect">/error.jsp</result> </action> <action name="charge" class="crm.web.struts.action.ChargeAction"> <result name="success">/index.jsp</result> <result name="input" type="redirect">/pay/charge.jsp</result> <result name="error">/error.jsp</result> </action> <action name="payAction" class="crm.web.struts.action.PayAction"> <result name="success">/index.jsp</result> <result name="input" type="redirect">/pay/pay.jsp</result> <result name="error">/error.jsp</result> </action> deleteuserjsp页面 </head> <body > <s:action name="loadMemberList!pageOfDelete" namespace="/" ></s:action> <%ArrayList list=(ArrayList)request.getAttribute("list"); Iterator it=list.iterator(); int i=0; Member m[]=new Member[5]; while(it.hasNext()){ m[i++]=(Member)it.next(); if(i==5){break;} } %> <s:url id="toLastPage" action="memberList!pageOfDelete" namespace="/" > <s:param name="pageType" value="-1"></s:param> </s:url> <s:url id="toNextPage" action="memberList!pageOfDelete" namespace="/" > <s:param name="pageType" value="1"></s:param> </s:url> <div class="twelve columns header_nav"> <div class="leftdiv" style="color:#FF4500;font-size:15px"><span>尊敬的<%=((User)session.getAttribute("currentUser")).getUserName()%>你好,</span><a href="<%=path%>/cancellation">退出</a></div> <div class="row"> <ul id="menu-header" class="nav-bar horizontal"> <li class="active"><a href="../index.jsp">Home</a></li> <li class="has-flyout"> <a href="#">会员信息管理</a><a href="#" class="flyout-toggle"></a> <ul class="flyout"><!-- Flyout Menu --> <li class="has-flyout"><a href="./adduser.jsp">会员信息增加</a></li> <li class="has-flyout"><a href="./deleteuser.jsp">会员信息删除</a></li> <li class="has-flyout"><a href="./alteruser.jsp">会员信息修改</a></li> </ul> </li><!-- END Flyout Menu --> <li class="has-flyout"> <a href="#">消息推送</a><a href="#" class="flyout-toggle"></a> <ul class="flyout"><!-- Flyout Menu --> <li class="has-flyout"><a href="../send/addsend.jsp">创建推送</a></li> <li class="has-flyout"><a href="../send/deletesend.jsp">删除推送</a></li> </ul> </li> <li class="has-flyout"> <a href="#">权限管理</a><a href="#" class="flyout-toggle"></a> <ul class="flyout"><!-- Flyout Menu --> <li class="has-flyout"><a href="../worker/addworker.jsp">增加收用户</a></li> <li class="has-flyout"><a href="../worker/deleteworker.jsp">删除用户</a></li> </ul> </li> <li class="has-flyout"> <a href="#">充值缴费</a><a href="#" class="flyout-toggle"></a> <ul class="flyout"><!-- Flyout Menu --> <li class="has-flyout"><a href="../pay/charge.jsp">充值</a></li> <li class="has-flyout"><a href="../pay/pay.jsp">缴费</a></li> </ul> </li> </ul> <script type="text/javascript"> //<![CDATA[ $('ul#menu-header').nav-bar(); //]]> </script> </div> </div> <section class="section_light"> <div class="row"><form method="post" action=""> <table class="table table-striped" > <thead> <tr> <th> 编号 </th> <th> 会员名 </th> <th> 卡号 </th> <th> 余额 </th> </tr> </thead> <tbody> <tbody> <tr> <td> 1 </td> <td> <%if(m[0]!=null){out.print(m[0].getName());}%> </td> <td> <%if(m[0]!=null){out.print(m[0].getId());}%> </td> <td> <%if(m[0]!=null){out.print(m[0].getOverage());}%> </td> </tr> <tr class="success"> <td> 2 </td> <td> <%if(m[1]!=null){out.print(m[1].getName());}%> </td> <td> <%if(m[1]!=null){out.print(m[1].getId());}%> </td> <td> <%if(m[1]!=null){out.print(m[1].getOverage());}%> </td> </tr> <tr class="error"> <td> 3 </td> <td> <%if(m[2]!=null){out.print(m[2].getName());}%> </td> <td> <%if(m[2]!=null){out.print(m[2].getId());}%> </td> <td> <%if(m[2]!=null){out.print(m[2].getOverage());}%> </td> </tr> <tr class="warning"> <td> 4 </td> <td> <%if(m[3]!=null){out.print(m[3].getName());}%> </td> <td> <%if(m[3]!=null){out.print(m[3].getId());}%> </td> <td> <%if(m[3]!=null){out.print(m[3].getOverage());}%> </td> </tr> <tr class="info"> <td> 5 </td> <td> <%if(m[4]!=null){out.print(m[4].getName());}%> </td> <td> <%if(m[4]!=null){out.print(m[4].getId());}%> </td> <td> <%if(m[4]!=null){out.print(m[4].getOverage());}%> </td> </tr> </tbody> </table></form> </div><div class="row"> <div style="float:left ;position:relative; left:30%;"><a href="<%=path%>/memberList!pageOfDelete?page_Type=-1"><img src="../images/last.jpg" width="81" height="26" /></a></div> <div style="float:left ; position:relative; left:50%;"><a href="<%=path%>/memberList!pageOfDelete?page_Type=1"><img src="../images/next.jpg" width="81" height="26" /></a></div> </div></br></br></br><div class="row"> <table ><form method="post" action="<%=path%>/deleteMember"> <tr> <td ><span>会员名</span> </td> <td ><div> <input name="name" type="text" id="huiyuanming" style="height:28px;width:267px;outline:none; vertical-align:middle;" /> </div></td> <td ><span>卡号</span> </td> <td ><div> <input name="id" type="text" id="kahao" style="height:28px;width:267px;outline:none; vertical-align:middle;" /> </div> </td> <td> <td colspan="2"><div align="center"><input name="deleteuse" type="submit" value="" style="border:none;background:url('../images/delete.jpg') left top no-repeat;width:81px; height:26px;" /></div></td> </td></tr></form> </table> </div></div> </section>
相见恨晚的超实用网站
相见恨晚的超实用网站 持续更新中。。。
字节跳动视频编解码面经
三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时想着能进去就不错了,管他哪个岗呢,就同意了面试...
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
python学习方法总结(内附python全套学习资料)
不要再问我python好不好学了 我之前做过半年少儿编程老师,一个小学四年级的小孩子都能在我的教学下独立完成python游戏,植物大战僵尸简单版,如果要肯花时间,接下来的网络开发也不是问题,人工智能也可以学个调包也没啥问题。。。。。所以python真的是想学就一定能学会的!!!! --------------------华丽的分割线-------------------------------- ...
python 简易微信实现(注册登录+数据库存储+聊天+GUI+文件传输)
socket+tkinter详解+简易微信实现 历经多天的努力,查阅了许多大佬的博客后终于实现了一个简易的微信O(∩_∩)O~~ 简易数据库的实现 使用pands+CSV实现数据库框架搭建 import socket import threading from pandas import * import pymysql import csv # 创建DataFrame对象 # 存储用户数据的表(...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 cpp 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7 p...
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小型人工智障。 知识可以运用在不同地方,不一定非是天气预报。
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
Python实例大全(基于Python3.7.4)
博客说明: 这是自己写的有关python语言的一篇综合博客。 只作为知识广度和编程技巧学习,不过于追究学习深度,点到即止、会用即可。 主要是基础语句,如三大控制语句(顺序、分支、循环),随机数的生成,数据类型的区分和使用; 也会涉及常用的算法和数据结构,以及面试题相关经验; 主体部分是针对python的数据挖掘和数据分析,主要先攻爬虫方向:正则表达式匹配,常用数据清洗办法,scrapy及其他爬虫框架,数据存储方式及其实现; 最后还会粗略涉及人工智能领域,玩转大数据与云计算、进行相关的预测和分析。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
JavaScript 为什么能活到现在?
作者 | 司徒正美 责编 |郭芮 出品 | CSDN(ID:CSDNnews) JavaScript能发展到现在的程度已经经历不少的坎坷,早产带来的某些缺陷是永久性的,因此浏览器才有禁用JavaScript的选项。甚至在jQuery时代有人问出这样的问题,jQuery与JavaScript哪个快?在Babel.js出来之前,发明一门全新的语言代码代替JavaScript...
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Python 编程开发 实用经验和技巧
Python是一门很灵活的语言,也有很多实用的方法,有时候实现一个功能可以用多种方法实现,我这里总结了一些常用的方法和技巧,包括小数保留指定位小数、判断变量的数据类型、类方法@classmethod、制表符中文对齐、遍历字典、datetime.timedelta的使用等,会持续更新......
吐血推荐珍藏的Visual Studio Code插件
作为一名Java工程师,由于工作需要,最近一个月一直在写NodeJS,这种经历可以说是一部辛酸史了。好在有神器Visual Studio Code陪伴,让我的这段经历没有更加困难。眼看这段经历要告一段落了,今天就来给大家分享一下我常用的一些VSC的插件。 VSC的插件安装方法很简单,只需要点击左侧最下方的插件栏选项,然后就可以搜索你想要的插件了。 下面我们进入正题 Material Theme ...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
相关热词 c#委托 逆变与协变 c#新建一个项目 c#获取dll文件路径 c#子窗体调用主窗体事件 c# 拷贝目录 c# 调用cef 网页填表c#源代码 c#部署端口监听项目、 c#接口中的属性使用方法 c# 昨天
立即提问

相似问题

2
reactjs无法连接后台:Could not proxy request xxx from localhost:3000 to http://localhost:8080/
3
jsp 使用 jstl <c:foreach> 执行问题
1
flask从数据库提取数据有Null值时,页面中会显示为None,请问怎么样才能在页面中显示为空白
1
一个关于使用JavaBean的问题(新手qiu'zhu)
1
求助!!SpringBoot+X-admin 动态表格页面无法显示
1
如何给table增加左右滚动条,滚动时列对不齐的问题
1
如何整合弹窗中自己输入的值和复选框为数组用于传参
2
为什么JS文件hide()方法不执行(我想用a标签控制表格显示)
3
使用esayUI,jpa,ajax模糊查询,他没报错,但查不到数据,请问哪里错了,谢谢
1
前端使用的layui的laydate插件,要实现选择一个时间范围,下边以表格的形式显示出对应的数据
2
html页面出现undefined如何解决
2
求教大神,原生JS,我想选中表格中的A标签。我写的代码怎么写都不对,求帮助。
2
制作一个考勤表格如何实现鼠标拖动选择多个单元格然后右键菜单实现批量考勤
2
html、js实现打印功能:表格过多的时候自动分页到另一页,但是每页保留页面的头部和尾部内容。
4
window.print()打印生成页面 chrome浏览器调用本地打印机,打印出来的效果很差
2
点击删除的时候,能找到当前条的数据,删除
1
easyui-datagrid 的load,loadData到底怎么用?感觉怎么用都不显示数据呢?
1
Thymeleaf异步请求发生灵异事件?
5
ssm+ajax查询数据库无反应
4
table如何让第一行固定住