Extjs登陆验证问题,求救!若问题解决200分送上。
public String loginOn() throws IOException{ String resultStr = SUCCESS; HttpServletResponse response = ServletActionContext.getResponse(); response.getWriter().print("{success:true,msg:'登录成功!'}"); return resultStr;}[code]这是我action中这样写的。。[code=JScript]login : function() { if (this.fp.form.isValid()) { this.fp.form.submit({ waitTitle : '请稍候', waitMsg : '正在登录......', url : 'user/loginOn.action', success : function(form, action) { Ext.Msg.alert('提示', action.result.msg); }, failure : function(form, action) { form.reset(); Ext.Msg.alert('警告', action.result.msg); } }); } }//actionpublic String query(){ try{ json=this.getUserService().queryUsers(); outJsonString(json); success=true; return null; //注意返回是null }catch(Exception e){ e.printStackTrace(); return "error"; } }//servicepublic String queryUsers(){ System.out.println("struts2 userService"); List<User> list=this.getUserDao().queryUsers(); //String str = this.getJsonarray().fromObject(list).toString(); //String json = "{\"totalProperty\":"+list.size()+",\"success\":true,\"root\":"+str+"}"; // System.out.println(json); String str="[{\"userno\":\"1\",\"userpassword\":\"q123456\",\"username\":\"li\"}]"; String json = "{totalProperty:1,root:"+str+"}"; return json; //\"success\":true, }
[解决办法]
方便的话将代码发到我邮箱zxingchao2005@126.com我看看
[解决办法]
美女 不 留恋csdn了,要经商了。