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 Brian Topping <to...@bill2.com> on 2004/01/03 05:42:26 UTC
Fix for variable app context roots posted
Hi all,
Thanks for an interesting product. I want to say "great", but I am just
getting to the point of booting it for the first time. So I've got to keep a
bit of excitement in reserve ;-)
I noticed that DeployableFile.getTestContext() returns a name that is always
the same -- the name of the war file. IMHO this seriously reduces the
applicability of Cactus for legacy apps (like the one I am currently working
on for a customer). Their app is located at the root context, and I expect a
lot of files would break if that were changed. I looked at the source and
decided to create a patch for this.
Since setting the root context is container-dependent and I can see from the
source that multiple container testing is allowed, I decided to put the
responsibility of determining the test root context with the container
implementation. Right now, all implementations except for JBoss3xContainer
will cause the name of the war file to be used for the context, as is the
current practice. If people want to update this for their favorite
container, it should be easier now that the interfaces are in place to handle
this. Take a look at the JBoss container for the pattern to follow.
I hope someone can find a few minutes to apply this patch. That would make
the effort worthwhile. It's at
http://issues.apache.org/bugzilla/show_bug.cgi?id=25859.
Happy new year!!
-b
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org
RE: Fix for variable app context roots posted
Posted by Vincent Massol <vm...@pivolis.com>.
Thanks Brian. I have applied your patch. If/when you have some time, it
would be great if you could verify it works. I am currently creating a
nightly build. It'll be on
http://cvs.apache.org/builds/jakarta-cactus/nightly/2004-01-10/ in 1 or
2 hours.
Thanks again for your patch!
-Vincent
> -----Original Message-----
> From: Brian Topping [mailto:topping@bill2.com]
> Sent: 03 January 2004 05:42
> To: cactus-dev@jakarta.apache.org
> Subject: Fix for variable app context roots posted
>
> Hi all,
>
> Thanks for an interesting product. I want to say "great", but I am
just
> getting to the point of booting it for the first time. So I've got to
> keep a
> bit of excitement in reserve ;-)
>
> I noticed that DeployableFile.getTestContext() returns a name that is
> always
> the same -- the name of the war file. IMHO this seriously reduces the
> applicability of Cactus for legacy apps (like the one I am currently
> working
> on for a customer). Their app is located at the root context, and I
> expect a
> lot of files would break if that were changed. I looked at the source
and
> decided to create a patch for this.
>
> Since setting the root context is container-dependent and I can see
from
> the
> source that multiple container testing is allowed, I decided to put
the
> responsibility of determining the test root context with the container
> implementation. Right now, all implementations except for
> JBoss3xContainer
> will cause the name of the war file to be used for the context, as is
the
> current practice. If people want to update this for their favorite
> container, it should be easier now that the interfaces are in place to
> handle
> this. Take a look at the JBoss container for the pattern to follow.
>
> I hope someone can find a few minutes to apply this patch. That would
> make
> the effort worthwhile. It's at
> http://issues.apache.org/bugzilla/show_bug.cgi?id=25859.
>
> Happy new year!!
>
> -b
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org
RE: Fix for variable app context roots posted
Posted by Vincent Massol <vm...@pivolis.com>.
Hi Brian,
> -----Original Message-----
> From: Brian Topping [mailto:topping@bill2.com]
> Sent: 03 January 2004 05:42
> To: cactus-dev@jakarta.apache.org
> Subject: Fix for variable app context roots posted
>
> Hi all,
>
> Thanks for an interesting product. I want to say "great", but I am
just
> getting to the point of booting it for the first time. So I've got to
> keep a
> bit of excitement in reserve ;-)
Thanks. Let us know how it goes... :-)
>
> I noticed that DeployableFile.getTestContext() returns a name that is
> always
> the same -- the name of the war file.
Yes. Except for EARs where it will also look in application.xml for any
context-root element.
> IMHO this seriously reduces the
> applicability of Cactus for legacy apps (like the one I am currently
> working
> on for a customer). Their app is located at the root context, and I
> expect a
> lot of files would break if that were changed. I looked at the source
and
> decided to create a patch for this.
>
cool.
> Since setting the root context is container-dependent and I can see
from
> the
> source that multiple container testing is allowed, I decided to put
the
> responsibility of determining the test root context with the container
> implementation. Right now, all implementations except for
> JBoss3xContainer
> will cause the name of the war file to be used for the context, as is
the
> current practice. If people want to update this for their favorite
> container, it should be easier now that the interfaces are in place to
> handle
> this. Take a look at the JBoss container for the pattern to follow.
>
> I hope someone can find a few minutes to apply this patch. That would
> make
> the effort worthwhile. It's at
> http://issues.apache.org/bugzilla/show_bug.cgi?id=25859.
Thanks! The patch looks good.
Personally I'm still unsure whether it's a good idea to use the same
context for testing than for the real runtime application. Using a
different context is a good test that verifies if there is nothing
hardcoded in the application... :-) That said, your case is one of a
legacy application which might have stuff hardcoded. You could still get
away with it by using the WebRequest.setURL() call to simulate a
different context.
However, even if the above is true, it's more of a best practice
question. I do agree that it's good to support container's standard
strategies for choosing the webapp's context. Whether users put a test
context name in JBoss web xml file or not is up to them.
I'll commit your patch today or tomorrow.
>
> Happy new year!!
You too, thanks
-Vincent
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org