2012년 4월 26일 목요일
jQuary Ajax Sample dataType 'json'
$.ajax({
type: "POST",
url: "<ContextRoot>/ajaxcall.dol",
data: param,
dataType: 'json',
success: function(result){
alert ("success");
var count = result.data.length;
var sampleData = result.data[?].?????;
},
error: function() {
alert("호출에 실패했습니다.");
}
});
@Controller
public Class SampleController {
@Requestmapping (value="ajaxcall.do",method=RequestMethod.POST)
public String sampleHandle (){
Map <String,Object> resultMap = new HashMap<String,Object>();
// method Function Start
// method Result Value
resultMap.put ("data",Object);
// method Function end
String returnValue = util.buildJson((HashMap) resultMap);
return returnValue;
}
}
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기