首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > J2EE开发 >

extjs提交到后台没有值,(数据没有提交到后台去)解决方案

2012-02-16 
extjs提交到后台没有值,(数据没有提交到后台去)extjs代码如下Ext.onReady(sysLogin)function sysLogin(){

extjs提交到后台没有值,(数据没有提交到后台去)
extjs代码如下
Ext.onReady(sysLogin);

function sysLogin()
{
var sysLoginPanel = new Ext.FormPanel({
width:448,
id:'_sysLoginPanel',
height:320,
layout:'column',
defaults:{
border:false
},
buttonAlign:'center',
items:[
{
height:58,
width:448,
xtype:'panel',
columnHeight:1,
border:false,
html:'<img src="'+rootPath+'/res/image/login-top.png"/>'
},
{
columnHeight:1,
width:448,
bodyStyle:'padding-left:10px',
defaults:{
border:false
},
layout:'column',
items:[
{
layout:'form',
xtype:'panel',
columnWidth:.7,
height:300,
labelWidth:50,
labelAlign:'right',
bodyStyle:'padding-left:30px',
defaultType:'textfield',
defaults:{
allowBlank:false,
border : false,
width:200
},
items:[
{
fieldLabel:'帐号',
cls:'login-user',
name:'userName',
blankText:'用户名不能为空'
},
{
fieldLabel:'密码',
inputType:'password',
cls:'login-password',
name:'userPwd',
blankText:'密码不能为空'
},
{
fieldLabel:'验证码',
cls:'login-code',
name:'userCode',
blankText:'验证码不能为空'
},
{
fieldLabel:'角色',
xtype:'combo',
mode:'local',
displayField:'role',
triggerAction: 'all',
emptyText:'Select a role',
valueField : "roleid",
store:new Ext.data.ArrayStore({
fields: ['roleid', 'role'],
data:[[1,'管理员'],[2,'渠道商'],[3,'审批员'],[4,'版主']]
})
},
{
xtype: 'checkboxgroup',
fieldLabel: '爱好',
allowBlank:true,
items: [
{boxLabel: '编码', name: 'cb-auto-1',inputValue:'1'},
{boxLabel: '购物', name: 'cb-auto-2', checked: true,inputValue:'2'},
{boxLabel: '看书', name: 'cb-auto-3',inputValue:'3'}
]
},
{
xtype: 'radiogroup',
fieldLabel: '性别',
style:'text-align:center',
items: [
{boxLabel: '男', name: 'sex',inputValue:'man'},
{boxLabel: '女', name: 'sex',inputValue:'woman'}
]
},
{
xtype : "panel",
layout:'column',
bodyStyle:'margin-left:55px',
width:300,
defaults:{
border : false
},
items : [
{
id : "loginCode",
columnWidth:.6,
html : '<img border="0" height="30" width="150" src="' + rootPath + '/CaptchaImg"/>'
},
{
xtype : "panel",
columnWidth:.4,
bodyStyle : "padding-top:10px",
html : '<a href="javascript:refeshCode()">看不清</a>'
}
]
}, {
xtype : "checkbox",
name : "_spring_security_remember_me",
inputValue:'remember_me',
boxLabel : "让系统记住我 "

]
},
{
width:'120',
xtype:'panel',
columnWidth:.3,
bodyStyle:'padding-top:40px;padding-right:20px',
html:'<img src="'+rootPath+'/res/image/login-user.jpg" />'


}
]
}
],
buttons:[
{
text:'登录',
iconCls:'ext-ok',
handler:function(){
var ff = Ext.getCmp("_sysLoginPanel").getForm();
if(ff.isValid())
{
ff.submit({
waitTitle : "请稍候",
waitMsg : "正在登录......",
url:rootPath+'/admin/sysLogin.do',
form:ff,
success:function(v)
{
Ext.Msg.alert("提示",v);
},
success:function(msg)
{
Ext.Msg.alert("提示",msg);
}
});
}
}
},
{
text:'重置',
iconCls:'ext-reset',
handler:function(){
Ext.getCmp("_sysLoginPanel").getForm().reset();
}
}
]
});

new Ext.Window({
title:'你好,请先登录',
width:450,
autoHeight:true,
closable:false,
items:sysLoginPanel
}).show();
}

function refeshCode()
{
Ext.getCmp("loginCode").body.update('<img border="0" height="30" width="150" src="'+rootPath + '/CaptchaImg?rand='+new Date()+'"/>');
}



后台处理代码如下:

Enumeration<String> e = request.getAttributeNames();
while(e.hasMoreElements())
{
String key = e.nextElement().toString();
System.out.println(key + " == " + request.getParameter(key));
}
response.setContentType("application/json;charset=UTF-8");
response.getWriter().print("{success:true}");
response.getWriter().close();

提交到后台去的时候,while循环一个都没有输出。(确认提交到后台去了)



[解决办法]
仔细检查!

热点排行