jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gennis Emerson <gemer...@vizdom.com>
Subject Re: conditional building of Cactus deployments
Date Sat, 03 Nov 2001 03:46:13 GMT
Erik Hatcher wrote:
> 
> ----- Original Message -----
> From: "Vincent Massol" <vmassol@octo.com>
> > yep, except I don't how it would work. The filter work this way: you
> define
> > a token in your web.xml (such as @cactus.web.xml@) and then in build.xml,
> > you would define the filter : <filter token="cactus.web.xml"
> value="xxx"/>.
> >
> > The problem is xxx ? Are you going to write the full cactus web.xml part
> in
> > a string ... ?
> 
> Yes.
> 
> <filter filtersfile="..."/>
> 
> The filters file would have the full Cactus web.xml part.  Wouldn't be
> pretty, but it would never need to be touched once specified.  It'd get too
> ugly with &lt;, &gt;, and &quot; stuff in a <filter> 'value'.


I've been doing essentially that for a while and been satisfied with it. 

In my web.xml: 

  <servlet> tags

  @cactus.redirectorservlet@

  <servlet-mapping> tags

In build.xml, for regular builds:

  <filter token="cactus.redirectorservlet" value=""/>
  <copy todir="${webapp.dir}/WEB-INF"
        file="${basedir}/etc/web.xml" 
        filtering="yes"/>

and for test builds:

  <filter filtersfile="${basedir}/etc/test/cactus.properties"/>
  <copy file="${basedir}/etc/web.xml" 
        todir="${webapp.dir}/WEB-INF"
        overwrite="yes"
        filtering="yes"/>      

I put the config in cactus.properties because it seemed like an easy
place to find it. This isn't going to wrap very well: 

cactus.redirectorservlet = \
    <servlet> \
     <servlet-name>ServletRedirector</servlet-name> \
    
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
\
    </servlet> \
    <servlet-mapping> \
     <servlet-name>ServletRedirector</servlet-name> \
     <url-pattern>/ServletRedirector/</url-pattern> \
    </servlet-mapping>


Basically, the run-tests target does a regular compilation, then
compiles the test classes into the same web app, copies in test support
files (junit, cactus, the filtered web.xml), and runs the tests. We
don't deploy with war files, so I don't have any experience with that.

Gennis

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


Mime
View raw message