SELECT * FROM the time the WHERE (title LIKE '%? % % ') OR (sub_title LIKE '? % ')
Mapper
//search, @ Param (" sub_title ") String sub_title
Public List
Service
Public List
List
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
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
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