Preventing access to certain servlets from outside
843842Mar 17 2010 — edited Mar 19 2010I have a set of servlets dedicated for sending responses to the client. These response servlets are used by forwarding the request with RequestDispatcher from other servlets. I would like to restrict the access of the servlets, so that they cannot be accessed directly by the client. What is the best way to do this?
I was looking at using a filter and setting the dispatcher tag to FORWARD in the filter mapping, but is there an easier way? Somehow with servlet mapping in the web.xml?
Thanks.