$. Ajax ({
//(1) generates an ajax format requirements and send
Type: "post",
Url: 'ImportManagementBase. HTML/token,
Data: {token: token},//TT_TOKEN to server cache
DataType: "json",
Success: the function (data) {
If (data. The status==200) {
Document. The getElementById (" username "). The value=https://bbs.csdn.net/topics/data.username;
}
}
});//get the user name end
Second, the backend:
@ RequestMapping (value="https://bbs.csdn.net/topics/ImportManagementBase.html/token", method=RequestMethod. POST)
@ ResponseBody
Public RunyiResult getUserByToken (String token) {
RunyiResult result=importManagementBaseService. GetUserByToken (token);
return result;
}
Three, the business process (abbreviated)
Four, important tip
Using the technology of pseudo static, among them, the web. XML related Settings are as follows:
*. JSP -->
5, an error:
The Request URL: http://localhost:8093/ImportManagementBase.html/token
The Request Method: POST
The Status Code: 404 Not Found
Remote Address: [: : 1) : 8093
The Referrer Policy: no - Referrer - the when - downgrade
Note:
I also used it on this page ajax, success: the following
$.post ("/ImportManagementBase. HTML ", $(" # customerImportForm "). The serialize (), function (data) {
If (data. The status==200)
{
ShowMessage (' you submit application has been successful, the application result will SMS you... ', 'success', 4000);
} else {
ShowMessage (' the server is busy, please try again later... 'and' error ', 4000);
}
});
Ask each ace to give directions, URL how change to be successful,