Configure the URL Access frequency limit and url Access Frequency

Source: Internet
Author: User

Configure the URL Access frequency limit and url Access Frequency
Configure the Access frequency limit of a URL to learn how to configure the Access frequency limit of a URL. It can be used to publish only two articles and money-related interfaces in an hour.

This guide guides you through configuring URL Access frequency limits.

How to complete this guide

You can start from scratch and complete each step, or you can bypass the basic setup steps you are already familiar. Either way, you can finally get the code that can work.

Configuration

Src/main/java/io/leopard/site/web/controller/FrequencyController. java

Package io. leopard. site. web. controller; import io. leopard. web4j. view. jsonView; import org. springframework. stereotype. controller; import org. springframework. web. bind. annotation. requestMapping; import io. leopard. web4j. method. annotation. frequency;/*** example of Access Frequency limit ** @ author **/@ Controllerpublic class FrequencyController {@ frequency (seconds = 1) @ RequestMappingpublic JsonView Frequency (long money) {return new JsonView ("increase the amount of money:" + money );}}
Summary

Congratulations! You have learned how to configure the URL Access frequency limit. Good luck.

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.