其实我正在使用extjs框架,并希望获得用户名以供进一步使用。任何人都可以帮我解决这个问题。 我的extjs代码就是这个....
var username= new Ext.form.field.Text({
width:300,
margin:'0 0 10 0',
name:'j_username',
fieldLabel:'Email',
allowBlank:false,
minLength:6,
maxLength:100
});
var password= new Ext.form.field.Text({
width:300,
margin:'0 0 10 0',
name:'j_password',
minLength:6,
maxLength:20,
inputType:'password',
allowBlank:false,
fieldLabel:'Password'
});
var signin = new Ext.form.Panel({
width:350,
renderTo:'signinform',
url:'j_security_check',
method:'POST',
title:'Sign In',
bodyPadding:20,
layout:'anchor',
items:[username,password,
{
xtype:'checkboxfield',
fieldName:'accept',
margin:'0 0 10 0',
boxLabel:'I Accept <a class="cont" id="tousignin" href="#"><u>Terms Of Use</u></a>',
hideLabel:true,
checked:true,
readOnly:true,
labelAlign:'left'
}],
standardSubmit:true,
buttons:[{
text:'Reset Your Password',
handler:function(){return false;
window.location.href=forgoturl;
}
},{
text:'Sign In',
handler:function(){
signin.submit();
}
}]
});
if(window.location.href.indexOf('j_security_check')>-1){
Ext.MessageBox.alert('Error','Invalid e-mail or password specified.');
}
并将此代码导入login.jsp页面,如下所示:
那么如何从中获取用户名?