日期:2014-05-16 浏览次数:20453 次
public String saveIndex(){
HttpServletResponse response = ServletActionContext.getResponse();
HttpServletRequest request = ServletActionContext.getRequest();
String queryParam = request.getParameter("param");
oplogE.info("param:"+queryParam);
JSONObject result = SearchManager.saveIndex(queryParam);//处理数据的方法
try {
response = initHeader(response);
response.getWriter().print(result);
} catch (IOException e) {
oplogE.error("保存检索式状态:", e);
}
return null;
}
Ext.Ajax.request( {
url :extPath + '/search!saveIndex.action',
params : {
param:inputData
},
method :'POST',
success : function(response) {
el.unmask();
var json = Ext.JSON.decode(response.responseText); // 获得后台传递json
if(json.success){
if(json.success == true){
Ext.Msg.alert('正确','保存成功!');
}else{
alert("abc");
Ext.Msg.alert('错误','保存失败!');
}
}else{
Ext.Msg.alert('错误','保存失败!');
}
},
failure: function(){
el.unmask();
Ext.Msg.alert('错误','保存失败!');
}
});