如何为嵌入式tomcat 8设置antiResourceLocking="true"
?
我找不到任何方法。
我使用嵌入式tomcat 8.5.8。
答案 0 :(得分:1)
将$array = [
0 => ['id' => 1, 'name' => 'Agent 1', 'total' => 3],
1 => ['id' => 2, 'name' => 'Agent 2', 'total' => 3],
2 => ['id' => 3, 'name' => 'Agent 3', 'total' => 3],
3 => ['id' => 1, 'name' => 'Agent 1', 'total' => 6],
];
$sumArray = [];
foreach ($array as $agentInfo) {
// create new item in result array if pair 'id'+'name' not exists
if (!isset($sumArray[$agentInfo['id'].$agentInfo['name']])) {
$sumArray[$agentInfo['id'].$agentInfo['name']] = $agentInfo;
} else {
// apply sum to existing element otherwise
$sumArray[$agentInfo['id'].$agentInfo['name']]['total'] += $agentInfo['total'];
}
}
// optional action to flush keys of array
$sumArray = array_values($sumArray);
print_r ($sumArray);
对象投射到org.apache.catalina.Context
,然后拨打org.apache.catalina.core.StandardContext
。