Hello All,

I've got a really weird problem using Cactus to test struts actions.  I 
just upgraded from the older commons cactus to 1.2.  I've got some server 
side testing code that mirrors Strut's ActionServlet: [This worked in the 
old Cactus]

ActionForward forward = controller.perform(
        mapping,
        null,
        request,
        response);

String path = forward.getPath();

assertTrue("Redirected To Error Page. " 
,       !(forward.getName().equals("error")));


if (path.startsWith("/")) {
        path = request.getContextPath() + path;
}

response.sendRedirect(response.encodeRedirectURL(path));

My problem is that when I hit the sendRedirect() things never redirect and 
instead in the client side I get an error code of:

302 - Temporarily Moved

The debug log on the server side shows [the relevant portion at least]

2001-10-23 15:16:44,400 DEBUG log.BaseLog 
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199)) - <isAutoSession
2001-10-23 15:16:44,570 DEBUG log.BaseLog 
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199)) - 
<setTestCaseFields
2001-10-23 15:16:52,151 DEBUG log.BaseLog 
(org.apache.cactus.util.log.BaseLog.entry(BaseLog.java:189)) 
- >getContextPath()
2001-10-23 15:16:52,501 DEBUG log.BaseLog 
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199)) - <getContextPath
2001-10-23 15:16:52,732 DEBUG log.BaseLog 
(org.apache.cactus.util.log.BaseLog.debug(BaseLog.java:94)) - Test result : 
[Test ok]
2001-10-23 15:16:52,912 DEBUG log.BaseLog 
(org.apache.cactus.util.log.BaseLog.debug(BaseLog.java:94)) - Result saved 
in context scope
2001-10-23 15:16:53,102 DEBUG log.BaseLog 
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199)) - <doTest
2001-10-23 15:16:53,283 DEBUG log.BaseLog 
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199)) - <doPost
2001-10-23 15:16:53,473 DEBUG log.BaseLog 
(org.apache.cactus.util.log.BaseLog.exit(BaseLog.java:199)) - <doPost


Does anybody have any idea of what's going on?

Thanks,
                                        -Mike

Reply via email to