I don't like messing with the web.xml, and neither do my managers. They seem
ok, just, about adding jspRedirector and servlet redirector, but polluting
the web.xml file with even more stuff will freak them out.
It's funny, they get the "are you sure? this doesn't feel right" look on
their faces. Is there a way to externalise as much of this configuration as
possible? Maybe like the proprietary web-container configs, ie, Weblogic has
a web.xml and a weblogic.xml. the weblogic.xml file contains the additions
to web.xml that are non-standard. Maybe cactus could have a cactus.xml
sitting in WEB-INF, which is pointed to by web.xml somehow.
___
dk-
-----Original Message-----
From: Vincent Massol [mailto:[EMAIL PROTECTED]]
Sent: Sunday, 22 July 2001 3:17 AM
To: [EMAIL PROTECTED]
Subject: [Cactus v2 - VOTE] Extension to web.xml mechanism
In order to be able to define different init values for different test
cases, we need to expand the current Cactus web.xml mapping mechanism.
Currently, in web.xml we define a single servlet : the Redirector Servlet,
as in :
<servlet>
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.commons.cactus.server.ServletTestRedirector</servl
et-class>
<init-param>
<param-name>param1</param-name>
<param-value>value1 used for testing</param-value>
</init-param>
</servlet>
This is not good enough, as I cannot have 2 test cases with 2 different
"param1" values for example.
* Proposition : several test mappings in web.xml
I propose to write instead :
<servlet>
<!-- Default for all test cases when no testcase specific entry is
defined -->
<servlet-name>ServletRedirector</servlet-name>
<servlet-class>org.apache.commons.cactus.server.ServletTestRedirector</servl
et-class>
</servlet>
<servlet>
<servlet-name>ServletRedirector_XXX1</servlet-name>
<servlet-class>org.apache.commons.cactus.server.ServletTestRedirector</servl
et-class>
<init-param>
<param-name>param1</param-name>
<param-value>value1</param-value>
</init-param>
</servlet>
[...]
<servlet>
<servlet-name>ServletRedirector_XXX2</servlet-name>
<servlet-class>org.apache.commons.cactus.server.ServletTestRedirector</servl
et-class>
<init-param>
<param-name>param1</param-name>
<param-value>value2</param-value>
</init-param>
</servlet>
The redirector URL defined in cactus.properties will be the prefix and will
get the testcase name prefixed to it. Cactus will have to scan the web.xml
file so that if no mapping is done on the name ServletRedirector_XXX it will
then use the URL defined in cactus.properties as is (with no suffixing).
I have no other simple ideas ...
Thanks
-Vincent