You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by Vincent Massol <vm...@pivolis.com> on 2004/03/18 23:02:21 UTC

RE: question about cactus innards

Hi Deryl,

> -----Original Message-----
> From: Deryl Seale [mailto:deryl@acm.org]
> Sent: 18 March 2004 22:29
> To: vmassol@pivolis.com
> Subject: question about cactus innards
> Importance: Low
> 
> Hi, Vincent.
> 
> I hope you'll forgive the direct email.  I am the designer and
> maintainer for StrutsTestCase, which as you know, relies in part on
> Cactus.  I am trying once and for all to fix a vexing problem related
> to CactusStrutsTestCase, and the root of the problem may lie in the
> innards of Cactus.
> 
> The problem is basically this: once I run any CactusStrutsTestCase in
a
> running container, the test work fine, but thereafter, the actual web
> application ceases to function.  More specifically, the Struts
> framework ceases to function properly, and I've traced this down to
> Cactus's hijacking and wrapping the ServletContext object for the
> running application.  Now, I understand why Cactus does this, but if
it
> were possible to get the *original* ServletContext instance -- that
is,
> the one that is being wrapped -- then I think I could restore the
> original settings and everything would be fine.  Trouble is, I can see
> anywhere that I can do that in the Cactus API.

The "request" object provided by the ServletTestCase is an instance of
HttpServletRequestWrapper and thus has a getOriginalRequest() method
that you can use to get the original request.

((HttpServletRequestWrapper) request).getOriginalRequest()

> 
> Am I crazy, or can this be done?  

It can :-)

> This is the number one complaint
> regarding StrutsTestCase, and I really want to get it fixed.  Your
help
> is much appreciated.

Cool. Let us know if you need any help.

Thanks!
-Vincent

PS: I'm ccing the cactus dev mailing list as this is of interest to all
Cactus developers.

> 
> thanks.
> -d.


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