P
P
pomaz_andrew2017-07-07 13:37:32
Java
pomaz_andrew, 2017-07-07 13:37:32

How to track client requests to a servlet?

Good day to all! There is an application on Angular which interacts with a servlet. There was a need to limit requests to the servlet to a maximum of 3 calls per day for one client. Identification of clients is planned by IP. What Java EE language mechanism will effectively solve this problem? As an option - HttpSession, but I want to know all the ways to solve the problem and choose the most efficient and technically beautiful one. Need an idea, servlet container is Tomcat 7. Thanks for the help.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
Fat Lorrie, 2017-07-07
@Free_ze

Servlet Filters at the UI level, or interceptors (at the business logic level).

A
Alexey Cheremisin, 2017-07-07
@leahch

Well, I would not identify by IP. At least by session + authorization, otherwise you will either block subnets with gray IPs, or there will be no protection at all.
Well, the right mechanism for you is servlet filter - www.journaldev.com/1933/java-servlet-filter-exampl...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question