利用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万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章