Re: Single WAR to update multiple contexts

2009-01-08 Thread Sean W

Using a single webapp sounds like a nice idea, and hopefully feasible, I will
look into this more since I think that solution would be the most efficient.
However, the reason why this would be difficult is:

I am using Apache Wicket's WicketServlet, which is mapped to a single Wicket
Application class. The Application class initializes many in-memory
variables that depend on which database it is initialized with. Recall the
database loaded depends on the context name.

I could try to create multiple WicketServlets within a single web-app, but I
rather avoid hard-coding the "list of 200 sites" into the WAR. Ideally using
the 1 web-app method I'd like to create a filter that will make:

"/ctx1/wicket/homepage" construct the wicket application using a config file
called ctx1 and 
"/ctx2/wicket/homepage" construct the wicket application using a config file
called ctx2 (if it exists) etc...

That way I'd only have to add/remove config files that contain database
connection info to add/remove "sites".

I will try to see if I can bend the functionality of WicketServlet to do
this. I'm not sure I can easily. Thanks!



Alan Chaney wrote:
> 
> Wouldn't it be easier to have ONE webapp and determine the database 
> from, for example, the URL its invoked with?
> 
> Its a little difficult to know exactly how you are doing things but 
> instead of having /ctx1 /ctx2 /ctx3 and mapping each one to ctx1.war
> why not have a filter in your setup which determines that its invoked 
> with /ctx1 and passes a parameter to the actual servlet which selects 
> the database you require? You could have one web app as ROOT and do it
> that way.
> 
> Maybe you could explain further why you need 200 separate versions where 
> the only difference is the name of the database?
> 

-- 
View this message in context: 
http://www.nabble.com/Single-WAR-to-update-multiple-contexts-tp21338593p21353649.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Single WAR to update multiple contexts

2009-01-07 Thread Alan Chaney

Sean

Wouldn't it be easier to have ONE webapp and determine the database 
from, for example, the URL its invoked with?


Its a little difficult to know exactly how you are doing things but 
instead of having /ctx1 /ctx2 /ctx3 and mapping each one to ctx1.war
why not have a filter in your setup which determines that its invoked 
with /ctx1 and passes a parameter to the actual servlet which selects 
the database you require? You could have one web app as ROOT and do it

that way.

Maybe you could explain further why you need 200 separate versions where 
the only difference is the name of the database?


Regards

Alan Chaney


Sean W wrote:

Greetings!

I have a single war packaged application that needs to have about 200 unique
context paths running (200 copies of the application running - each uses a
different database based on the context name).

I know how to deploy 1 context at a time, but how can I do this so that if I
want to update all these contexts to the "next version", I can update them
all at the same time easily?

Any suggests are much appreciated. Thanks!
-Sean W





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org