Hello,
I was wondering whether it is possible to forward a request to another web application residing on a completely different Web Application Server.
My code always returns null for the servletContext I try to get:
Servlet in application A:
try {
// code that throws NotAuthorizedException
} catch (NotAuthorizedException e) {
// forward to not authorized page
ServletContext sc = this.getServletContext().getContext("/Intranet/notAuthorized.html");
//sc == null by here
sc.getRequestDispatcher("/Intranet/notAuthorized.html");
e.printStackTrace();
}
Please note that the getContext() method requires a URI. But how the heck does it find the html page page in the Intranet application. I'm confused here except when it's just not possible this way,
thanx,
Philip.