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);

}

[1084 byte] By [venkyfunkya] at [2007-11-27 9:51:13]
# 1
send me stack trace/error message!Thanksism
smile4ua at 2007-7-13 0:20:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
You've probably got a mapping in your web.xml file which is directing all requests back to itself. Check mapping that contain wildcards...
d11wtqa at 2007-7-13 0:20:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

thanks for the reply.

but my entry in the web.xml looks clean.

here a snippet of the same.

<filter-mapping id="FilterMapping_4">

<filter-name>bmjsp</filter-name>

<url-pattern>*.jsp</url-pattern>

</filter-mapping>

<filter id="Filter_1">

<filter-name>bmhtml</filter-name>

<filter-class>com.bluemartini.html.HTMLFilter</filter-class>

</filter>

<filter id="Filter_2">

<filter-name>bmjsp</filter-name>

<filter-class>com.bluemartini.jsp.JSPFilter</filter-class>

</filter>

<filter-mapping id="FilterMapping_1">

<filter-name>bmhtml</filter-name>

<url-pattern>*.jsp</url-pattern>

</filter-mapping>

can u site any other reason ?

venkyfunkya at 2007-7-13 0:20:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...