Hey John,

Thanks for the advice. I didn't get it to work, but I *did* spend a few hours on it and discovered something interesting. Here's the steps I followed:

1.) I first introduced new internal redirects, commenting out the old ones:

<map:match pattern="secure/doTest">
 <map:act type="perform-test">
   <!-- Test succeeded. -->
   <!--map:redirect-to uri="cocoon:/showTestSucceededPage"/-->
   <map:redirect-to uri="cocoon:/myTestSucceeded"/>
 </map:act>

 <!-- Test failed. -->
 <!--map:redirect-to uri="cocoon:/showTestFailedPage"/-->
 <map:redirect-to uri="cocoon:/myTestFailed"/>
</map:match>

This actually works on the first request but not after that! (Yes, I'm resetting the state of my db after each request so I can test this Cocoon stuff independently of that state.)

BTW, the new redirects go to extremely basic straight HTML pages for which the code is like 3 lines (<html><head><title>...</title></head> <body>Some Text</body></html>), and these simple pages are fetched with a simple <map:read mime-type="html" src="..."/>)

2.) So I comment out the new redirects, uncomment the old redirects, and try 1 more request:

<map:match pattern="secure/doTest">
 <map:act type="perform-test">
   <!-- Test succeeded. -->
   <map:redirect-to uri="cocoon:/showTestSucceededPage"/>
   <!--map:redirect-to uri="cocoon:/myTestSucceeded"/-->
 </map:act>

 <!-- Test failed. -->
 <map:redirect-to uri="cocoon:/showTestFailedPage"/>
 <!--map:redirect-to uri="cocoon:/myTestFailed"/-->
</map:match>

This request doesn't work (shows "test failed" instead of "test succeeded"), though I didn't really expect it to.

3.) So now I go back to how it was in Step 1--and then it works! BUT only the FIRST time!


And I can repeat the above behavior over and over, getting it to work but only once. So it seems like it might have something to do with pipeline setup or something...I just don't know.


BTW, simply reuploading the sitemap after Step 1 doesn't get it to work either. I actually have to go through the 3 steps exactly as I mentioned.

Hopefully this sparks some insight? I sure hope one of us can figure it out...this scenario can happen to anyone!

Sincerely,

Sonny

From: "John L. Webber" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: map:redirect-to...
Date: Thu, 29 Jul 2004 09:18:43 +0200

Hi Sonny,

The only other thing I can suggest trying is to reproduce the bug with an alternate matcher, using different redirect resources and a different action. If the bug doesn't happen then, try swapping in your actual resources one at a time, and then your action. Something like:

<map:match pattern="secure/reallySimpleTest">
  <map:act type="always-succeeds">
    <map:redirect-to uri="cocoon:/pageExists1"/>
  </map:act>
  <map:redirect-to uri="cocoon:/pageExists2"/>
</map:match>

If that works as expected (i.e. no bug), try replacing the first redirect with your actual redirect. Of course, you'll have to create the new resources first!

Good luck,

John


Sonny Sukumar wrote:

Hey John,

I took your advice and spent some time culling through sitemap.log and discovered that BOTH redirects are taking place when I use internal redirects...it's just that the "test failed" redirect happens second, so I always see that result page (even though the action's operations in modifying the database, etc. are performed successfully).

Why this happens is still a mystery to me, but here's the sitemap log info showing this:

INFO (2004-07-28) 10:47.42:387 [sitemap] (/secure/doTest) http8443-Processor2/RedirectToURINode: Redirecting to 'cocoon:/showTestSucceededPage' at file:/usr/local/tomcat/webapps/cocoon/sitemap.xmap:1750:62

INFO (2004-07-28) 10:47.42:388 [sitemap] (/secure/doTest) http8443-Processor2/ForwardRedirector: Redirecting to 'cocoon:/showTestSucceededPage'

INFO (2004-07-28) 10:47.42:711 [sitemap] (/secure/doTest) http8443-Processor2/RedirectToURINode: Redirecting to 'cocoon:/showTestFailedPage' at file:/usr/local/tomcat/webapps/cocoon/sitemap.xmap:1755:68

INFO (2004-07-28) 10:47.42:712 [sitemap] (/secure/doTest) http8443-Processor2/ForwardRedirector: Redirecting to 'cocoon:/showTestFailedPage'

So I then tried--just for the heck of it--putting an html serializer right after the first redirect like this:

<map:match pattern="secure/doTest">
 <map:act type="perform-test">
   <!-- Test succeeded. -->
   <map:redirect-to uri="cocoon:/showTestSucceededPage"/>
   <map:serialize type="html"/>
 </map:act>

 <!-- Test failed. -->
 <map:redirect-to uri="cocoon:/showTestFailedPage"/>
</map:match>

And of course that didn't work either. :-) Sooo...maybe there's a bug with internal redirects?

BTW, I'm using the absolute latest stable version of Cocoon (2.1.5.1) on Tomcat 4.1.30. I upgraded just a few days ago...

Sonny

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to