Home > Back-end >  Why front pass the value of the back-end for less than, a great god help look at it
Why front pass the value of the back-end for less than, a great god help look at it

Time:11-25

XML

Mapper
//search, @ Param (" sub_title ") String sub_title
Public List Searchbox (@ Param (" title ") String title);
Service
Public List Searchbox (String title) {

List Time3.=apiMapper searchbox (title);
System. The out. Println (" 123456 "+ time3);
System. The out. Println (" 852 "+ time3);
Return time3.

}
The controller
@ RequestMapping (value="https://bbs.csdn.net/searchbox", method=RequestMethod. POST)
Public List Searchbox (it request, HttpServletResponse response) {

response.setContentType("text/html; charset=utf-8");
/* set response headers allow ajax cross-domain access */
The response. SetHeader (" Access - Control - Allow - Origin ", "*");
/* asterisk said all foreign request can be accepted, */
Response. SetHeader (" Access - Control - Allow - the Methods ", "the GET and POST");

String formData=https://bbs.csdn.net/topics/request.getParameter (" formData ");

List Time3.=apiService searchbox (formData);
System. The out. Println (" search====="+ time3);
Return time3.

}

This is the front small program
Wx. Request ({

Url: 'http://localhost:8089/api/searchbox',
Data: {
FormData: formData
},
Method: "POST",
The content-type header: {' ':' application/x - WWW - form - urlencoded "'},

Success: the function (res) {
The console. The log (res) data)
That the setData ({
Re: res. Data,
})

Wx. ShowToast ({
Title: 'submitted',
Icon: 'success',
Duration: 2000
})
}
})

[123456]
[852]
Search=====[]
Take less than the value, what is wrong, the great god help show

  • Related