jquery converts the array into a string and then transmits it to the server (after jquery converts the array into a string, the format is such as 1, 2, 3, speed, rewr)
Receive the string passed by jquery, parse it into an array, and then convert the array into a list collection
/**
* Delete private messages in batches.
*/
@RequestMapping(value = "/delete", method = {RequestMethod.GET,RequestMethod.POST} )
public ResponseEntity
delete(HttpServletRequest request) {
// List of private message IDs to be deleted
String messageIds = ServletRequestUtils.getStringParameter(request, "ids", "");
String [] messageList=messageIds.toString().split(",");
List messageIdList = Arrays.asList(messageList);//The array is converted into a list
logger.info("--- ---------" messageIds);
logger.info("------------" messageList[0]);
try {
boolean opStatus = messageManager.delete(messageIdList);
logger.info("Delete private message: opStatus={}", opStatus);
return this.okResponse(opStatus);
} catch (Exception e) {
logger.error("An exception occurred while adding a private message, Cause: ", e);
return this.errorResponse(e.getMessage());
}
}