@RequestMapping(value="/ceshi4",method=RequestMethod.POST)
@ResponseBody
//如果使用对象封装前端传来数据去掉@RequestParam
public Map
结果
如果使用Pojo对象来接收ajax发送的表单信息
必须去掉@RequestParam
@RequestMapping(value="/ceshi4",method=RequestMethod.POST)
@ResponseBody
//如果使用对象封装前端传来数据去掉@RequestParam
public Map ddd( User user){
Map m = new HashMap();
System.out.println(user.getUsername());
System.out.println(user.getPassword());
m.put("username", user.getUsername());
m.put("password", user.getPassword());
return m;
}
结果
接下来是使用的是application/json; charset=UTF-8; 做测试
ajax代码
function fn1(){
//alert("1");
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
var json = {
"username" : username,
"password" : password
};
$.ajax({
url:"ceshi4",
type:"POST",
data:JSON.stringify(json), //转换成json
success:function(data){
for(var i in data){
alert(JSON.stringify(data));//alert json对象
}
},
//contentType : "application/x-www-form-urlencoded; charset=UTF-8",
contentType : "application/json; charset=UTF-8",
dataType:"json"
});
}
--分组取最大最小常用sql--测试环境if OBJECT_ID('tb') is not null drop table tb;gocreate table tb( col1 int, col2 int, Fcount int)insert into tbselect 11,20,1 union allselect 11,22,1 union allselect 1
一、函数的使用
1.1、定义函数变量
var vName = funcation(params){
}
1.2、函数的调用
函数变量的调用: vName(params);
函数定义时自发调用:(function(params){})(params);
1.3、函数中变量赋值
var a = 'a';
var ff
Mac mini 型号: MC270CH-A RMB:5,688
Apple 对windows的产品支持不好,有以下问题:
1.装完了xp,发现机身很热虽然没有运行任何程序!貌似显卡跑游戏发热一样,按照那样的发热量,那部机子损耗很大,使用寿命受到严重的影响!
2.反观安装了Mac os的展示机,发热量很小,运行了1天温度也没有那么高
&nbs
Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given ta