jquery param data Array parameter serialization

Source: Internet
Author: User
Tags serialization
Background

In a front-end browser in a Java Web project, you need to pass a list object (variable-length array) to the background .

How to pass an array object to the background in a browser. Solution solution (front desk)

Enter a URL in the browser
Localhost:8080/localtest.action?names%5b%5d=zhangsan,lisi,wangmazi

In fact, here's the%5b%d, Unicode encoding format that can be referenced in my another article in JS and coding problems.

Where name is defined as a background variable name, the List names parameter, and its implementation class can be ArrayList and other solutions (background)

You can use the attribute value in spring's annotation @requestParam to list[]
That is @requestParam (value= "list[]") List names
will be accepted.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.