You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stuart Stephen <st...@talkics.com> on 2003/12/03 11:05:37 UTC

response.sendRedirect() finite loop?!

talk2UtimeHi all,

I am getting strange entries in my test_service_log.2003-12-03.txt.

In my JSP which gets executed before this I am running a
response.sendRedirect("/test/RedirectToMe.jsp"); with a return; afterwards.
So this should only get executed once. However. According to my logs its
being accessed 1333 times in just SIX seconds [line count / 2]. I am the
ONLY person on the server and therefore this is strange occurance!

I checked the corresponding apache logs and this servlet was not in the
logs, the servlet before hand which does the redirect was the only servlet
that has been accessed externally. This is true from what the user sees.

Is this a bug in Tomcat 4.1.29 or has something changed? I've been using
Tomcat for a few years now and I've never seen anything like this?

Regards,

Stuart Stephen

2003-12-03 09:32:08 StandardContext[/t2ut]: Mapping contextPath='/test' with
requestURI='/test/RedirectToMe.jsp' and relativeURI='/RedirectToMe.jsp'
2003-12-03 09:32:08 StandardContext[/t2ut]: Mapped to servlet 'jsp' with
servlet path '/RedirectToMe.jsp' and path info 'null' and update=true
2003-12-03 09:32:08 StandardContext[/t2ut]: Mapping contextPath='/test' with
requestURI='/test/RedirectToMe.jsp' and relativeURI='/RedirectToMe.jsp'
2003-12-03 09:32:08 StandardContext[/t2ut]: Mapped to servlet 'jsp' with
servlet path '/RedirectToMe.jsp' and path info 'null' and update=true
...
...
...
2003-12-03 09:32:14 StandardContext[/t2ut]: Mapping contextPath='/t2ut' with
requestURI='/t2ut/RoomTimes.jsp' and relativeURI='/RoomTimes.jsp'
2003-12-03 09:32:14 StandardContext[/t2ut]: Mapped to servlet 'jsp' with
servlet path '/RoomTimes.jsp' and path info 'null' and update=true
2003-12-03 09:32:14 StandardContext[/t2ut]: Mapping contextPath='/t2ut' with
requestURI='/t2ut/RoomTimes.jsp' and relativeURI='/RoomTimes.jsp'
2003-12-03 09:32:14 StandardContext[/t2ut]: Mapped to servlet 'jsp' with
servlet path '/RoomTimes.jsp' and path info 'null' and update=true

RE: response.sendRedirect() finite loop?!

Posted by sr...@g88.net.
> On further investigation it would appear that this is not a Tomcat
> issue. It seems to be something to do with mod_jk. When a
> response.sendRedirect occurs it does not apply it properly. Or at
> least something is not executing properly.
>
> The setup we have is Apache 2.0.48, Tomcat 4.1.29, and mod_jk
> between them working with mod_ssl. I tested the code without using
> apache between me and Tomcat and everything worked as expected.

Just out of curiosity, are you using mod_rewrite?  If your .jsp
redirects A -> B, and you are rewriting B -> A, then this will produce
behavior similar to what you're seeing.  (However, you'd also see one
line for each "loop" iteration in Apache's access log).

Are there any HTTP headers returned via

  response.sendRedirect("/test/RedirectToMe.jsp");

(Should be an HTTP 302 with a Location: header).

Also, what is the url for the servlet/jsp that makes the above call?

-- 
Steve

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: response.sendRedirect() finite loop?!

Posted by Stuart Stephen <st...@talkics.com>.
Hi,

On further investigation it would appear that this is not a Tomcat issue. It
seems to be something to do with mod_jk. When a response.sendRedirect occurs
it does not apply it properly. Or at least something is not executing
properly.

The setup we have is Apache 2.0.48, Tomcat 4.1.29, and mod_jk between them
working with mod_ssl. I tested the code without using apache between me and
Tomcat and everything worked as expected.

Any suggestions or comments??

Regards
Stuart

-----Original Message-----
From: Stuart Stephen [mailto:stuart.stephen@talkics.com]
Sent: 03 December 2003 10:06
To: tomcat-user@jakarta.apache.org
Subject: response.sendRedirect() finite loop?!


talk2UtimeHi all,

I am getting strange entries in my test_service_log.2003-12-03.txt.

In my JSP which gets executed before this I am running a
response.sendRedirect("/test/RedirectToMe.jsp"); with a return; afterwards.
So this should only get executed once. However. According to my logs its
being accessed 1333 times in just SIX seconds [line count / 2]. I am the
ONLY person on the server and therefore this is strange occurance!

I checked the corresponding apache logs and this servlet was not in the
logs, the servlet before hand which does the redirect was the only servlet
that has been accessed externally. This is true from what the user sees.

Is this a bug in Tomcat 4.1.29 or has something changed? I've been using
Tomcat for a few years now and I've never seen anything like this?

Regards,

Stuart Stephen

2003-12-03 09:32:08 StandardContext[/t2ut]: Mapping contextPath='/test' with
requestURI='/test/RedirectToMe.jsp' and relativeURI='/RedirectToMe.jsp'
2003-12-03 09:32:08 StandardContext[/t2ut]: Mapped to servlet 'jsp' with
servlet path '/RedirectToMe.jsp' and path info 'null' and update=true
2003-12-03 09:32:08 StandardContext[/t2ut]: Mapping contextPath='/test' with
requestURI='/test/RedirectToMe.jsp' and relativeURI='/RedirectToMe.jsp'
2003-12-03 09:32:08 StandardContext[/t2ut]: Mapped to servlet 'jsp' with
servlet path '/RedirectToMe.jsp' and path info 'null' and update=true
...
...
...
2003-12-03 09:32:14 StandardContext[/t2ut]: Mapping contextPath='/t2ut' with
requestURI='/t2ut/RoomTimes.jsp' and relativeURI='/RoomTimes.jsp'
2003-12-03 09:32:14 StandardContext[/t2ut]: Mapped to servlet 'jsp' with
servlet path '/RoomTimes.jsp' and path info 'null' and update=true
2003-12-03 09:32:14 StandardContext[/t2ut]: Mapping contextPath='/t2ut' with
requestURI='/t2ut/RoomTimes.jsp' and relativeURI='/RoomTimes.jsp'
2003-12-03 09:32:14 StandardContext[/t2ut]: Mapped to servlet 'jsp' with
servlet path '/RoomTimes.jsp' and path info 'null' and update=true



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org