public String userName(){
CommonUtils.getReqHost(request);
boolean flag = userServer.findByUserName(useraccount);
if(flag){
request.setAttribute("message", "恭喜您,"+useraccount+"可以修改");
return "have";
}
request.setAttribute("message", "用户不存在");
//this.addFieldError("userErr", "用户不存在");
return "not_have";
}
我现在想将jsp的用户名提交到action中,然后将action中的信息回调到jsp中
ajax要怎么写
看看这个对你有帮助吗
你在js里调用ajax请求将数据传到后台,后台处理好后,通过response的输出流将你要返回页面的数据写进去,在ajax的success回调里获取就行了
先导入jquery包,json包
http://blog.csdn.net/hanqunfeng/article/details/5299175
你直接在返回值里返回数据不就好了