求助,jQuery拿不到返回值。。

o0zone777 2010-02-01 10:28:46
ActionBean:

public ActionForward doCheckUser(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws IOException {

Icp_zcForm icp_zcForm = null;
IIcp_zcService icp_zc = new Icp_zcServiceImpl();
String username="";
if(request.getParameter("username")!=null){
username = request.getParameter("username");
}
List list = icp_zc.getUserUnique(username, this.getServlet().getServletContext());
if(list!=null){
if(list.size()!=1){
System.out.println("Fail");
response.getWriter().print("您申请的用户名称已被占用");
return mapping.findForward("icp_first_zc");
}else{
System.out.println("Succ");
response.getWriter().print("恭喜您!您可以使用这个用户名!");
return mapping.findForward("icp_first_zc");
}
}
return null;

}
}

JS

CheckUser=function(ContextPath){
var username = (document.getElementById('icp_zc_1')).value;

if(username==""){
alert('用户名不能为空!')
(document.getElementById('icp_zc_1')).focues();
return false;
}
var pat=ContextPath+"/icp/icp_zc.do?method=doCheckUser&username="+username;
$.get(pat,null,function(responseTxt){
alert(responseTxt);});
}

responseTxt拿回来了发出请求的网页的源码。。。晕。。。求各位大侠帮忙
...全文
43 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
xinlan1022 2010-02-02
  • 打赏
  • 举报
回复
return null;试试
o0zone777 2010-02-02
  • 打赏
  • 举报
回复
哦了~~return null搞定~
zhj92lxs 2010-02-02
  • 打赏
  • 举报
回复
return mapping.findForward("icp_first_zc");
这个换成return null试试
crazylaa 2010-02-01
  • 打赏
  • 举报
回复
[Quote=引用楼主 o0zone777 的回复:]
responseTxt拿回来了发出请求的网页的源码。。。晕。。。求各位大侠帮忙
[/Quote]
赶紧取拿别的网站,源码啊!很珍贵的。。。

jquery不懂的帮顶。

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧