前台jsp发送不同参数,为何servlet返回同样的结果? 本帖最后由 jiangsongnian 于 2014-09-17 09:20:26 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 js function loadRcglAppServerMaintence(plugin,title){ var servletUrl = basePath + 'AppServerServlet.do?oper='; var $dg = null; var dialog; var p_id = -1,script_type; $dg = $('#'+plugin); var idField = 'p_id'; var sortName = 'p_id'; var rows; $dg.datagrid({ toolbar: '#appServMantainceToolbar', //title:title, //width:'auto', //height: maxH1, //fitColumns: true, iconCls:'icon-save', autoRowHeight: false, singleSelect:true, striped: true, fit: true, method:'get', url: servletUrl + 'getAppServerGrid', sortName: sortName, sortOrder: 'asc', remoteSort: true, idField: idField, rownumbers:true, onSelect : function(rowIndex, rowData){ p_id = rowData['P_ID']; }, columns:[[ {field: 'P_ID', title:'ID', width:120, align:'center', hidden: true}, {field: 'P_NAME', title:'应用名称', width:140, align:'center'}, {field: 'P_MANAGER1', title:'第一负责人', width:80, align:'center'}, {field: 'P_MANAGER2', title:'第二负责人', width:80, align:'center', hidden: true}, {field: 'APP_IP', title: '服务器地址',width: 90, align: 'center', sortable: true}, {field: 'APP_PORT', title: '端口',width: 70, align: 'center'} //{field: 'AVIENDTIME', title: '过期时间',width: 120, align: 'center'}, //{field: 'QUERY_CF', title: 'QUERY_CF',width: 100, align: 'center'}, //{field: 'QUERY_TOPIC', title: 'QUERY_TOPIC',width: 100, align: 'center'} ]] }); $('#btnAppFind').on('click',function(){ search('searchValueApp',$dg,'P_NAME,P_MANAGER1,P_MANAGER2,APP_IP'); $('#searchValueApp').focus(); }); bindButtonToInputBox('searchValueApp','btnAppFind'); $('#searchAppValue').focus(); $('#zhcx_btnSeeApp').on('click',function(){ execScript(p_id,'see'); }); $('#zhcx_btnStopApp').on('click',function(){ execScript(p_id,'stop'); }); $('#zhcx_btnStartApp').on('click',function(){ execScript(p_id,'start'); }); $('#zhcx_btnRestartApp').on('click',function(){ execScript(p_id,'restart'); });//发送IP、远程脚步类型参数到servlet var execScript = function(pId, scriptType) { if(pId==-1){ return false; } console.info(pId + ' ' + scriptType); $('#zhcx_app_dialog').dialog('open'); $('#scriptResult').panel('open'); $('#scriptResult').panel({content:''}); $('#netStatus').datagrid('getPanel').panel('close'); //$.post(servletUrl + 'excuteScript' , { p_id: pId, script_type: scriptType },//ajax发送、接收数据 $.ajax({ type:'post', url: servletUrl + 'excuteScript', data: 'p_id=' + pId+'&script_type='+scriptType, dataType:'json', success: function(data){ closeDialog(); $('#scriptResult').panel({content:data.msg}); } }); } netMonitor(p_id);//$('#divAddLjxdQueryUser').dialog('open'); $('#zhcx_netMonitor').on('click',function(){ $('#scriptResult').panel({content:' '}) $('#scriptResult').panel('close'); $('#netStatus').datagrid('getPanel').panel('open'); getNetStatus(p_id); }); function getNetStatus (pId){ if(pId==-1){ return false; } $('#zhcx_app_dialog').dialog('open'); $.ajax({ type: 'post', url: servletUrl + "netMonitor", data: "p_id=" + pId, dataType: 'json', success: function(data){ closeDialog(); if(data.success){ $("#netStatus").datagrid('loadData',data); }else{ alert(data.msg); } } }); } function netMonitor ( pId ) { $("#netStatus").datagrid({ title:'网络状态', rownumbers:true, width:'auto', //height: maxH2, //autoRowHeight: false, singleSelect:true, striped: true, fit: true, method:'get', remoteSort: false, //url: servletUrl + 'netMonitor&p_id='+ pId, sortName: 'CONNECTCOUNT', sortOrder: 'desc', //remoteSort: true, //idField: 'IP', columns:[[ {field: 'IP', title:'IP地址', width:120, align:'center',sortable:true}, {field: 'CONNECTCOUNT', title:'连接数', width:140, align:'center',sortable:true}, {field: 'CONNECTTYPE', title:'连接类型', width:140, align:'center',sortable:true}, {field: 'ISNORMAL', title:'状态', width:80, align:'center',sortable:true} ]], rowStyler: function(index,row){ if (row.ISNORMAL=='异常'){ return 'color:#f00;'; } } }); } var $dialog ; function initDialog () { $dialog=$('#zhcx_app_dialog').dialog({ title: '', width: 500, height: 50, closed: true, closeable: false, modal: true }); } function showDialog (){ $('#zhcx_app_dialog').dialog('open'); } function closeDialog (){ $('#zhcx_app_dialog').dialog('close'); } } js判断半角符号 这个怎么做的? wap 关于jsp:useBean的问题!! 下拉框可输入值,并且下拉时下拉框的宽度可以变大小 代码没有问题,但是Tomcat仍然报错。 请大家帮帮忙 地球人都应该知道的问题,顶者也有分,谢谢。 请教大家! hibernate的分页真的通用吗?我这种情况怎么分页? Struts2+uploadify-3.1调不到后台action怎么回事,求帮助!!! 关于JS文件的格式
js
function loadRcglAppServerMaintence(plugin,title){
var servletUrl = basePath + 'AppServerServlet.do?oper=';
var $dg = null;
var dialog;
var p_id = -1,script_type;
$dg = $('#'+plugin);
var idField = 'p_id';
var sortName = 'p_id';
var rows;
$dg.datagrid({
toolbar: '#appServMantainceToolbar',
//title:title,
//width:'auto',
//height: maxH1,
//fitColumns: true,
iconCls:'icon-save',
autoRowHeight: false,
singleSelect:true,
striped: true,
fit: true,
method:'get',
url: servletUrl + 'getAppServerGrid',
sortName: sortName,
sortOrder: 'asc',
remoteSort: true,
idField: idField,
rownumbers:true,
onSelect : function(rowIndex, rowData){
p_id = rowData['P_ID'];
},
columns:[[
{field: 'P_ID', title:'ID', width:120, align:'center', hidden: true},
{field: 'P_NAME', title:'应用名称', width:140, align:'center'},
{field: 'P_MANAGER1', title:'第一负责人', width:80, align:'center'},
{field: 'P_MANAGER2', title:'第二负责人', width:80, align:'center', hidden: true},
{field: 'APP_IP', title: '服务器地址',width: 90, align: 'center', sortable: true},
{field: 'APP_PORT', title: '端口',width: 70, align: 'center'}
//{field: 'AVIENDTIME', title: '过期时间',width: 120, align: 'center'},
//{field: 'QUERY_CF', title: 'QUERY_CF',width: 100, align: 'center'},
//{field: 'QUERY_TOPIC', title: 'QUERY_TOPIC',width: 100, align: 'center'}
]]
});
$('#btnAppFind').on('click',function(){
search('searchValueApp',$dg,'P_NAME,P_MANAGER1,P_MANAGER2,APP_IP');
$('#searchValueApp').focus();
});
bindButtonToInputBox('searchValueApp','btnAppFind');
$('#searchAppValue').focus();
$('#zhcx_btnSeeApp').on('click',function(){
execScript(p_id,'see');
});
$('#zhcx_btnStopApp').on('click',function(){
execScript(p_id,'stop');
});
$('#zhcx_btnStartApp').on('click',function(){
execScript(p_id,'start');
});
$('#zhcx_btnRestartApp').on('click',function(){
execScript(p_id,'restart');
});//发送IP、远程脚步类型参数到servlet
var execScript = function(pId, scriptType) {
if(pId==-1){
return false;
}
console.info(pId + ' ' + scriptType);
$('#zhcx_app_dialog').dialog('open');
$('#scriptResult').panel('open');
$('#scriptResult').panel({content:''});
$('#netStatus').datagrid('getPanel').panel('close');
//$.post(servletUrl + 'excuteScript' , { p_id: pId, script_type: scriptType },//ajax发送、接收数据
$.ajax({
type:'post',
url: servletUrl + 'excuteScript',
data: 'p_id=' + pId+'&script_type='+scriptType,
dataType:'json',
success: function(data){
closeDialog();
$('#scriptResult').panel({content:data.msg});
}
});
}
netMonitor(p_id);//$('#divAddLjxdQueryUser').dialog('open');
$('#zhcx_netMonitor').on('click',function(){
$('#scriptResult').panel({content:' '})
$('#scriptResult').panel('close');
$('#netStatus').datagrid('getPanel').panel('open');
getNetStatus(p_id);
});
function getNetStatus (pId){
if(pId==-1){
return false;
}
$('#zhcx_app_dialog').dialog('open');
$.ajax({
type: 'post',
url: servletUrl + "netMonitor",
data: "p_id=" + pId,
dataType: 'json',
success: function(data){
closeDialog();
if(data.success){
$("#netStatus").datagrid('loadData',data);
}else{
alert(data.msg);
}
}
});
}
function netMonitor ( pId ) {
$("#netStatus").datagrid({
title:'网络状态',
rownumbers:true,
width:'auto',
//height: maxH2,
//autoRowHeight: false,
singleSelect:true,
striped: true,
fit: true,
method:'get',
remoteSort: false,
//url: servletUrl + 'netMonitor&p_id='+ pId,
sortName: 'CONNECTCOUNT',
sortOrder: 'desc',
//remoteSort: true,
//idField: 'IP',
columns:[[
{field: 'IP', title:'IP地址', width:120, align:'center',sortable:true},
{field: 'CONNECTCOUNT', title:'连接数', width:140, align:'center',sortable:true},
{field: 'CONNECTTYPE', title:'连接类型', width:140, align:'center',sortable:true},
{field: 'ISNORMAL', title:'状态', width:80, align:'center',sortable:true}
]],
rowStyler: function(index,row){
if (row.ISNORMAL=='异常'){
return 'color:#f00;';
}
}
});
}
var $dialog ;
function initDialog () {
$dialog=$('#zhcx_app_dialog').dialog({
title: '',
width: 500,
height: 50,
closed: true,
closeable: false,
modal: true
});
}
function showDialog (){
$('#zhcx_app_dialog').dialog('open');
}
function closeDialog (){
$('#zhcx_app_dialog').dialog('close');
}
}