In my application I have the following filter in web.xml
<filter>
<filter-name>webServiceFilter</filter-name>
<filter-class>org.bakhtiari.filter.WebServiceFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>webServiceFilter</filter-name>
<url-pattern>/webservice/RestEasy/*</url-pattern>
</filter-mapping>
And two dispatcher Servlets are declared
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>resteasy-servlet</servlet-name>
<url-pattern>/webservice/RestEasy/*</url-pattern>
</servlet-mapping>
Now suppose a single HTTP request comes to url "/webservice/RestEasy/redirect/callUserService".
Considering my business, if the third part of URL is equal to "redirect" I have to call the URL "/rest/callUserService".
With all this in mind, I want to send a request to "mvc-dispatcher" with new URL and retrieve HTTPServletResponse
from that.
Note that I cannot send a request to new URL using java.net or something like that, because my application has security filter on "/*" URLs and putting authentication parameters in each request cause lots of overload on server.