利用ajax請求的post如何傳遞數據

@Action(value="telephone")
public String telephoneValidation() throws Exception{
ServletActionContext.getResponse().setContentType("utf-8");
//利用web service完成電話號碼的驗證
//獲取telephone
String telephone = (String) ServletActionContext.getContext().getParameters().get("tlephone");
Customer customer = WebClient.create("http://localhost:9002/crm_management/services/customerService/telephoneValidation/"+telephone).accept(MediaType.APPLICATION_JSON).get(Customer.class);
if(customer != null){
ServletActionContext.getResponse().getWriter().write("此號碼已經被佔用");
System.out.println("此號碼已經被佔用");
}else {
ServletActionContext.getResponse().getWriter().write("此號碼可用");
System.out.println("此號碼可用");
}
return NONE;
}
發佈了25 篇原創文章 · 獲贊 7 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章