The application of Ajax in SPRINGMVC to considerations

Source: Internet
Author: User

The use of Ajax:

Precautions:

DataType: "JSON" can be written in Ajax without writing (Ajax can automatically recognize the return value type), written more standardized, you can identify the wrong return value type of Ajax, specify the return value type so that there is no error.

The @responsebody annotation must be written on the class method, and the returned data can be written directly to the response text. It is more used when the AJAX process requests asynchronously.

Apputil.returnobject (New Pagedata (), PD); It's also possible to change the PD here to map.

Apputil.returnobject (Pd,map) method of source code:

After reading the source I found that this method does not need to be converted into JSON format.

Directly return the map, written in response text by @responsebody, (Ajax datatype: "JSON") can be written and written in a more canonical.

The application of Ajax in SPRINGMVC to considerations

Related Article

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.