jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russ Baker <rba...@NETdelivery.com>
Subject RE: Multiple apps and the cactus.properties file
Date Fri, 16 Nov 2001 17:20:09 GMT
You the man!

Thanks,

RB

-----Original Message-----
From: Vincent Massol [mailto:vmassol@octo.com]
Sent: Friday, November 16, 2001 9:54 AM
To: Cactus Users List
Subject: Re: Multiple apps and the cactus.properties file


Thanks Russ, I have already written it ... yesterday night but my internet
connection was failing and I forgot to commit it, will do it now.
Thanks again
-Vincent

----- Original Message -----
From: "Russ Baker" <rbaker@NETdelivery.com>
To: "'Cactus Users List'" <cactus-user@jakarta.apache.org>
Sent: Friday, November 16, 2001 4:40 PM
Subject: RE: Multiple apps and the cactus.properties file


> Hi,
>
> I like the suggestion.  What I am thinking of doing is this:  In the
> checkConfigProperties() of the ClientConfigurationChecker class, I can put
> the following statement:
>
>     public static void checkConfigProperties()
>     {
> InputStream is = null;
> String configString = null;
> try
> {
> System.getProperties("cactus.config");
> if(configString  == null)
> {
> is =
> ClientConfigurationChecker.class.getResourceAsStream(configString);
> }
> else
> {
> is =
> ClientConfigurationChecker.class.getResourceAsStream(
>             "/" + AbstractHttpClient.CONFIG_NAME + ".properties");
> }
>       if (is == null) {
>             String msg = "The Cactus '" + AbstractHttpClient.CONFIG_NAME
> +
>                 ".properties' configuration file need to be
> present in the " +
>                 "java CLASSPATH (i.e. the directory that
> contains it need " +
>                 "to be added to the CLASSPATH).";
>             throw new RuntimeException(msg);
>       }
> }
> catch(SecurityException se)
> {
> throw new RuntimeException("Security manager will not allow
> access to the system property cactus.config."+
> " Please edit your java.policy file to allow this
> access.");
> }
> catch(IllegalArgumentException iae)
> {
> throw new RuntimeException("The key cactus.config does not
> exist.");
> }
>     }
>
> Is this Kosher?
>
> Russ
>
>
> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@octo.com]
> Sent: Thursday, November 15, 2001 12:41 PM
> To: Cactus Users List
> Subject: Re: Multiple apps and the cactus.properties file
>
>
>
>
> ----- Original Message -----
> From: "Russ Baker" <rbaker@NETdelivery.com>
> To: "'Cactus Users List'" <cactus-user@jakarta.apache.org>
> Sent: Wednesday, November 14, 2001 9:50 PM
> Subject: Multiple apps and the cactus.properties file
>
>
> > I have a question about having multiple apps, but one location to test
> them
> > from.  In the cactus.properties file, we define the context for the
> > ServletRedirector and the JSPRedirector as being:
> > cactus.servletRedirectorURL =
> > http://localhost:80/testApp/servlet/ServletRedirector/
> > cactus.jspRedirectorURL =
> http://localhost:80/testApp/servlet/JspRedirector/
> >
> > However, in our case we may have several apps, but we want to make sure
> that
> > the context is preserved.  What we have done is put the servlet
> information
> > into the web.xml file in our test app (test context), but when we test
> other
> > servlets in other apps (other contexts) the RequestDispatcher tries to
do
> a
> > forward and gives a null pointer exception.
> >
> > The thought I had was to put different versions of the cactus.properties
> > file in each of the web apps WEB-INF/classes directory with their own
> > context (e.g. cactus.servletRedirectorURL =
> > http://localhost:80/realWebbAppContext/servlet/ServletRedirector/).
Will
> > this work, or will it always default to the one we place in the
> applications
> > classpath?
>
> no because the cactus.properties file is only used on the client side
(which
> finds in it the url to call the redirector). At the moment, this is not
> supported. Here is what I propose :
> - define a -Dcactus.config=<location of cactus.properties file> that
> overrides any cactus.properties put in the classpath.
> - this would let you define several <junit> task in your ant build file
and
> pass a different cactus.properties file for the different applications to
> test.
>
> Do you like it ?
> -Vincent
>
> >
> > Thanks,
> >
> > Russ
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:cactus-user-help@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:cactus-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:cactus-user-help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<mailto:cactus-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:cactus-user-help@jakarta.apache.org>
>
>


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

--
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