Do the login authentication asynchronous submission to pass a parameter to actio

Is written like this before

<s:textfield name="u.username" label="User name"></s:textfield>

Ajax don't know how to realize the automatic extraction of u.username and injected
Beginners please enlighten

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("Login Shibai");
}}
});
}

Started by Amanda at December 13, 2016 - 4:44 PM

var params = {
"user.username":$("#username").val(),
"user.password":$("#password").val()
};

Change
var params = {
"u.username":$("#username").val(),
"u.password":$("#password").val()
};

Posted by Montague at December 15, 2016 - 5:26 PM

Or it is written
"username":$("#username").val(),

Posted by Montague at December 23, 2016 - 6:06 PM

No transfer success.

Posted by Amanda at December 24, 2016 - 6:57 PM