Home > Web Front-end > JS Tutorial > body text

How to implement springmvc to extract data after receiving the array submitted by jquery

php中世界最好的语言
Release: 2017-12-31 10:57:01
Original
1320 people have browsed it

What I bring to you this time is how to implement springmvc to extract data after receiving the array submitted by jquery. This article will give you a good analysis.

The specific code is as follows:

var selectedUsers = $('#users').tagbox('getValues');
if (selectedUsers.length > 0) {
  $.post(appPath + "/role/users/add/", {
    'systemID' : $('#systemID').combobox('getValue'),
    'roleID' : roleID,
    'users' : selectedUsers
  }, function(result, status) {
    if (result == 'false') {
      $.messager.show({
        title : '角色管理',
        msg : '添加用户发生异常'
      });
    }
    // 刷新被选择的用户
    getSelectedRoleUsers();
});
Copy after login

selectedUsers What is obtained is an array, submitted under the name users


@PostMapping("/users/add/")
@ResponseBody
public String addUsers(String systemID, String roleID, @RequestParam(name = "<SPAN style="COLOR: #ff0000">users</SPAN><SPAN style="COLOR: #ff0000">[]</SPAN>") String[] users) {
}
Copy after login

I believe you have mastered the method after reading the above introduction. For more exciting information, please pay attention to the php Chinese website Other related articles!

Related reading:

How can JS click to jump to the logged-in personal mailbox

##require.js Detailed introduction to usage

There are several ways to implement chain operations in PHP

The above is the detailed content of How to implement springmvc to extract data after receiving the array submitted by jquery. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template