jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Rabe <dr...@opentext.com>
Subject RE: Struts, Cactus, multiple config.xml files
Date Mon, 12 Jan 2004 17:13:06 GMT

Thanks for the explanation - that makes sense.

I use the ant <cactifywar> task to generate the cactus web.xml. Is there any
way to get <cactifywar> to automatically copy these parameters to the
ServletRedirector entry?

Daniel Rabe

-----Original Message-----
From: Vincent Massol [mailto:vmassol@pivolis.com] 
Sent: Saturday, January 10, 2004 3:10 PM
To: 'Cactus Users List'
Subject: RE: Struts, Cactus, multiple config.xml files

Hi Daniel,

The way Cactus currently works is by calling the Servlet redirector (and not
your servlet under test). Thus if you have any web.xml parameters you need
to set them under the servlet redirector, so that they appear in the
"config" object available in your ServletTestCase. Alternatively you can
call config.setInitParameter() from your test (it simulates init-parameters
in web.xml).

Hope it helps,

> -----Original Message-----
> From: Daniel Rabe [mailto:drabe@opentext.com]
> Sent: 30 December 2003 19:46
> To: 'Cactus Users List'
> Subject: RE: Struts, Cactus, multiple config.xml files
> I now see my problem, but don't know how to fix it.
> In the setUp method for my tests, I do "new ActionServlet()", and then 
> "actionServlet.init( config )". The problem is that this "config" is
> config for the ServletRedirector servlet, not the servlet I'm trying
> test! How can I get the config for the servlet I'm testing?
> Or, better yet, how can I get a reference to the servlet instance that
> created when the container started?
> Thanks,
> Daniel Rabe
> -----Original Message-----
> From: Daniel Rabe [mailto:drabe@opentext.com]
> Sent: Monday, December 29, 2003 6:45 PM
> To: 'Cactus Users List'
> Subject: Struts, Cactus, multiple config.xml files
> I've been using Cactus to test a struts 1.1 webapp. It was working...
> then I decided to split up my struts-config.xml file because it was 
> getting large. In the web.xml, I use a comma-separated list of my 
> config.xml
> for param-name config. Note that I'm NOT using struts modules. It
> correctly when deployed as a webapp with Tomcat 5.x.
> However, when I try to run my cactus test suite, I get a lot of
> path" errors. After examining debug logs, it's clear that:
> (a) the Digester correctly reads the comma-separated list of config
> but
> (b) the only config file that's processed is struts-config.xml: 
> <ActionServlet> Initializing module path '' configuration from 
> '/WEB-INF/struts-config.xml'
> Does cactus support this configuration? If so, any thoughts on what I 
> might be doing wrong???
> Constructive suggestions are GREATLY appreciated! Thanks!!
> Daniel Rabe

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

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message