@RequestMapping(value="/getStateNames",method = RequestMethod.POST)
public @ResponseBody RegionDistrict add(HttpServletRequest request, HttpServletResponse response,@RequestParam String region, @RequestParam String stId) {
System.out.println("Get state");
}
$.ajax({
type: "POST",
//contentType : "application/json",
dataType : "json",
url: "getStateNames",
//url:"http://localhost:8081/Mining_22_11_17/pages/admin/a.jsp",
cache: false,
data: "region=" + re + "& stId=" + state_id,
success: function(response){
//$('#result').html("");
alert("hiiii state list");
var obj = JSON.parse(response);
alert("state list" + obj);
//$('#result').html("First Name:- " + obj.firstName +"</br>Last Name:- " + obj.lastName + "</br>Email:- " + obj.email);
},
error: function(){
alert('Error while request..');
}
});
Spring MVCのコントローラはPOSTを使用して要求を送信します。
再と状態はスクリプトで – jeevanswamy21
httpsを宣言STATE_ID解決するかどうか私に教えてください:// WWWを。 – jeevanswamy21