Is there a way to prevent other sites from hotlinking to your servlet?
My servlet serves files and I don't want it to be called from another website.
Thanks
Using the HttpServletRequest and ServletRequest objects, there are methods to determine the "forwarding" URL, and IP and machine name (I forget the precise methods, but take a look at the API docs) - so you could test these - if they are not yours, then dump the request.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.