jsp中的分页(pagination in jsp)
我有一个超过3000行结果集的查询。 我使用迭代器来迭代每条记录。 所以我必须减少系统的负载,我想最好的方法是在jsp中使用分页。 如果有人有更好的主意,我会很高兴听到它。 类似于获取数字或类似的东西。 演示技术是struts。 如果您认为分页很好,请帮助我。
I have a query with more than 3000 rows result set. I used an iterator to iterate each record. So I have to reduce the load of system and I suppose the best way is using the pagination in jsp. If anyone has a better idea I would be glad to hear it. something like fetch number or something like this. The presentation technology is struts. If you think pagination is good please help me.
原文:https://stackoverflow.com/questions/13134912
最满意答案
创建一个可调整大小的集合,然后检查每个元素是否出现在第二个列表中(如果没有则添加它):
# items can be added to a collection # this method creates an empty array and pass it to a collection $missingSoftware = {""}.Invoke() Foreach($name in $softwareList){ # if doesnt appear if (-not($softwareToBeInstalled.name.Contains($name))){ # add it to the collection $missingSoftware.add($name) } } write $missingSoftware
Create a collection which is resizeable, then check for each element if its appears on the 2nd list ( and add it if not ):
# items can be added to a collection # this method creates an empty array and pass it to a collection $missingSoftware = {""}.Invoke() Foreach($name in $softwareList){ # if doesnt appear if (-not($softwareToBeInstalled.name.Contains($name))){ # add it to the collection $missingSoftware.add($name) } } write $missingSoftware
相关问答
更多-
一个非Underscore解决方案,即.map()是新数组,如果它可以.find()返回对象,否则返回一个新对象: var original = [ { Country: 'US', value: '10' }, { Country: 'Turkey', value: '5' } ]; var newlist =["Afghanistan", "Antarctica","Turkey"] var result = newlist.map(function(v) { retur ...
-
在Array中搜索对象(Search for object in Array)[2023-07-16]
因为您直接比较代码中的对象,您可以尝试: if(output[i] output[i]['Box'] === obj['Box']) { continue; } 在您的代码中,您需要在输出中执行另一个循环来进行比较,例如: function isHasObj(output,obj){ for (var j = 0; j < output.length; ++j) { if (output[j]['Box'] === obj['Box']) { return ... -
有了array.prototype.every和array.prototype.find ,它应该是: const myArray = ["foo", "bar"]; const testArray1 = [ {name: "foo"}, {name: "bar"}, {name: "something else"} ]; const testArray2 = [ {name: "foo"}, {name: "rab"}, {name ...
-
使用Array.map()迭代该series ,并通过当前字符串从count获取值: const count = { amazing: 8, amenities: 6, awesome: 7, beautiful: 15, better: 9, clean: 12, comfortable: 8, complaint: 6, 'definitely stay': 6, excellent: 11, friendly: 17, 'front desk': 8, good: 15, gorgeous: 6, g ...
-
this关键字在构造之前并不指向当前对象。 我猜测this是指下一个最高范围,或者您的案例中的Window对象。 浏览器控制台中的快速测试: var a = {"test": this}; console.log(a["test"]); //Window 当你需要这种聚集的数据,或者找到一种更好的方式来填充这个属性时,你最好能够随时进行查询。 The this keyword does not point to your current object until it is constructed. I' ...
-
按另一个数组的值对StdClass对象数组进行排序(Sorting an StdClass Object Array by the values of another array)[2022-03-31]
尝试这个 $sortedArray = []; foreach ($order as $termId) { foreach ($objects as $object) { if ($object->term_id == $termId) { $sortedArray[] = $object; } } } $objects保存您的stdClass实例,并使用有序的术语ID对您的列表进行订购。 如果term_id应始终以递增顺序排序,则可 ... -
您可以在浏览器中使用console.dir() 。 const arr = [ { subArr: [ { subSubArr:[ { a:1 } ] } ] } ]; console.dir(arr, { depth: null }); You can use console.dir() in browser. ...
-
使用-notin或-notcontains运算符。 $importvms | ?{$_.Name -notin $vms.name} | %{ Do Stuff } 别名? 用于Where ,以及用于ForEach % 。 好的,它不起作用我们可以尝试从当前VM名称数组中构建一个正则表达式匹配字符串,并将每个导入的VM与其匹配,以查看它是否已存在。 试试这个脚本: Connect-VIServer -Server vCenter -Protocol https -Force | out-null $imp ...
-
创建一个可调整大小的集合,然后检查每个元素是否出现在第二个列表中(如果没有则添加它): # items can be added to a collection # this method creates an empty array and pass it to a collection $missingSoftware = {""}.Invoke() Foreach($name in $softwareList){ # if doesnt appear if (-not($softwareToBe ...
-
既然您要求采用ES6方法,那么这个解决方案可能正是您所需要的。 [].concat(...metadata.map(item => item.controls.map(obj => obj.fieldName))); Since you're asking for an ES6 approach, this solution might be what you're looking for. [].concat(...metadata.map(item => item.controls.map(obj = ...