处理页面都读到数据了,但没有回调success对应的方法??提交页面:Ext.onReady(function(){
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
var simple = new Ext.FormPanel({
labelWidth: 75,
baseCls: 'x-plain',
defaults: {width: 150},
defaultType: 'textfield',
items: [{
fieldLabel: '账户',
name: 'name',
//anchor:'95%',
allowBlank:false,
blankText:'账户不能为空'
},{
inputType:'password',
fieldLabel: '密码',
//anchor:'95%',
name: 'pws',
allowBlank:false,
blankText:'密码不能为空'
}
], buttons: [{
text: '确定',
type: 'submit',
handler:function(){
if(simple.form.isValid()){
simple.form.doAction('submit',{
url:'check.jsp',
method:'post',
params:'',
success:function(form,action){
alert("xiaoge");
if (action.result.msg=='ok') {
//document.location='index.html';
Ext.Msg.alert('提示窗口','提交已成功');
} else {
Ext.Msg.alert('登录错误',action.result.msg);
}
},
failure:function(){
Ext.Msg.alert('错误','服务器出现错误请稍后在试!');
}
});
}
}
},{
text: '取消',
handler:function(){simple.form.reset();}
}]
});
win = new Ext.Window({
id:'win',
title:'注册窗口',
layout:'fit',
width:300,
height:150,
plain:true,
bodyStyle:'padding:5px;',
maximizable:false,
closeAction:'close',
closable:false,
collapsible:true,
plain: true,
buttonAlign:'center',
items:simple
});
win.show();
});处理页:
request.setCharacterEncoding("gb2312");
String name=request.getParameter("name");
String pws=request.getParameter("pws");
System.out.println(name+" "+pws);
if(name.equals(pws)){
System.out.println("ok");
out.print("{success:true,msg:'ok'}");
}else{
out.print("{failure:true,msg:'帐户或密码错误'}");
}
Ext.QuickTips.init();
Ext.form.Field.prototype.msgTarget = 'side';
var simple = new Ext.FormPanel({
labelWidth: 75,
baseCls: 'x-plain',
defaults: {width: 150},
defaultType: 'textfield',
items: [{
fieldLabel: '账户',
name: 'name',
//anchor:'95%',
allowBlank:false,
blankText:'账户不能为空'
},{
inputType:'password',
fieldLabel: '密码',
//anchor:'95%',
name: 'pws',
allowBlank:false,
blankText:'密码不能为空'
}
], buttons: [{
text: '确定',
type: 'submit',
handler:function(){
if(simple.form.isValid()){
simple.form.doAction('submit',{
url:'check.jsp',
method:'post',
params:'',
success:function(form,action){
alert("xiaoge");
if (action.result.msg=='ok') {
//document.location='index.html';
Ext.Msg.alert('提示窗口','提交已成功');
} else {
Ext.Msg.alert('登录错误',action.result.msg);
}
},
failure:function(){
Ext.Msg.alert('错误','服务器出现错误请稍后在试!');
}
});
}
}
},{
text: '取消',
handler:function(){simple.form.reset();}
}]
});
win = new Ext.Window({
id:'win',
title:'注册窗口',
layout:'fit',
width:300,
height:150,
plain:true,
bodyStyle:'padding:5px;',
maximizable:false,
closeAction:'close',
closable:false,
collapsible:true,
plain: true,
buttonAlign:'center',
items:simple
});
win.show();
});处理页:
request.setCharacterEncoding("gb2312");
String name=request.getParameter("name");
String pws=request.getParameter("pws");
System.out.println(name+" "+pws);
if(name.equals(pws)){
System.out.println("ok");
out.print("{success:true,msg:'ok'}");
}else{
out.print("{failure:true,msg:'帐户或密码错误'}");
}
解决方案 »
- SqlServer 2005 ibatis配置文件sql出错
- 我在servlet中发送邮件怎么会抛出java.lang.NoClassDefFoundError: javax/mail/Address异常呢?
- proxool的奇怪问题
- 关于hibernate延迟加载--》高手请进:)
- 很奇怪的问题 :Tomcat server.xml的配置虚拟目录影响session会话
- Jboss控制台左边导航树没有,怎么解决??急
- websphere在同时连接数上是不是有限制
- 一个怪问题!如何解决?????
- 每次重新打包覆盖以前的jar时,就出错
- 关于调用各大电子商务网站的API 接口疑问
- 关于throw new exception()的问题
- java学习
PrintWriter out = request.getOutputStream();
out.write("{success: true}");
out.flush();
out.close();