用ssh框架和ajax做登录验证异步提交时怎么传递参数给action中的getter
之前是这样写的
<s:textfield name="u.username" label="用户名"></s:textfield>
function valid() {
var url = 'login.action';
var params = {
"user.username":$("#username").val(),
"user.password":$("#password").val()
};
jQuery.ajax({
type: "post",
async: true,
url: url,
data: params,
contentType: "application/json; charset=utf-8",
dataType:"text",
success:function (data){
if(data.info == "error"){
alert("登录shibai");
}}
});
}