i have created the js file for this purpose but i cannot find a way to limit the access after 3 failed attempts based on user's ip address. can someone please suggest me a way to do that? i do not have spring on my application, just simple java servlets and jsps.
You can configure
fail2ban to watch your webserver logs. Just be sure to log something when a login fails to your web app.
Note - if the person who fails is behind NAT, you'll be blocking all people coming from behind that address. In theory, this lets one person's actions block an entire college, corporation, etc.