RequestDispatcher.forward goes to an infinite loop
Hey All,
I am trying to redirect my jsp page to a different page. Am using the forward function of the RequestDispatcher, but for some reason its entering an infinite loop. The only reason that I could site is the page re-calling itself. But i checked to see the pat of the destination jsp being passed to the dispatcher and its as expected.
I am using forward as I dont want to use redirect in my code.
The format of the file i am passing is "/myFile.jsp" and this is as expected.
Any help on this front would be greatly appreciated..
Below is the code of the calling jsp.
HTMLCookie testCookie = htmlContext.getCookie("test-cookie");
if (testCookie != null) {
String sRequestedTemplate = dnaFormData.removeString("requestTemplate");
RequestDispatcher dispatcher = getServletConfig().getServletContext().getRequestDispatcher(sRequestedTemplate);
if (dispatcher != null) {
dispatcher.forward(request, response);
}
}
else {
GymboErrorUtil.setCookieDisabledError(htmlContext);
}

