@chiragtakkar5
A servlet can be triggered from backend, front end, 3rd Party application or even manually, hitting the Servlet URL - anything or everything that can use Http Protocol.
From Client or Browser end, ajax call is the best way to call the servlet. Write your ajax code, in jsp, js, ...