You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Sean W <se...@bibliofiche.com> on 2009/01/08 17:41:53 UTC
Multiple Copies of One Wicket App
Greetings,
I am trying to set up a single WAR (web app) that can use as many as 200
different databases depending on the request path.
Normally we have:
/ContextPath/WicketServlet/BookmarkablePage
I am trying to make:
/ContextPath/FileName/WicketServlet/BookmarkablePage
Where FileName is a configuration file on the server containing database
connection info.
Is there a way to pass this "FileName" to wicket's Application object? Is it
possible to use WicketFilter for this? I'm having trouble finding relevant
examples. Any help or alternate approaches would be helpful.
Thanks!
FYI: I currently have a 1-web app, 1-servlet, 1-application setup. I
basically need to make a couple hundred seemingly-independent copies of the
same program (more multiple clients) using most efficient method.
--
View this message in context: http://www.nabble.com/Multiple-Copies-of-One-Wicket-App-tp21355510p21355510.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Multiple Copies of One Wicket App
Posted by Steve Swinsburg <s....@lancaster.ac.uk>.
You're doing it backwards. Have one webapp which accepts the parameter
at the end of the URL, not before.
cheers,
Steve
On 9 Jan 2009, at 13:36, Sean W wrote:
>
> path:
> /ContextPath/wicket/BookmarkablePage
>
> It appears to me that using Wicket you cannot place anything in the
> path
> between the context path and the mounted name except for "wicket",
> which is
> defined as your <url-pattern>. In other words, a mounted page cannot
> be
> referenced from more than one path. This also means Wicket can't
> support
> "sub contexts".
>
> Perhaps I'll have to try and deploy a single app 200 times in tomcat
> with
> the same WAR. :-S
> --
> View this message in context: http://www.nabble.com/Multiple-Copies-of-One-Wicket-App-tp21355510p21372369.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
Re: Multiple Copies of One Wicket App
Posted by Jim Pinkham <pi...@gmail.com>.
I have a follow-up question related to this.
My current setup is simply myclient.war with my web.xml having one
filter-name and one filter-mapping with url-pattern /* so my home page is
myhost/myclient. Life is good, but now I'm growing!
What I'd like to do is have separate versions of the app for several
clients. So I'd rename myclient.war to generic.war, then have
several filter-mappings with url-pattern /myclient and /mynewclient. I
think this way I can have specific init-param entries for each one and get
the right database and so forth for each one - that's pretty much how I
read this answer, so that's great as far as it goes.
So my followup question is, I have some ThisPage.properties files with text
specific to my current client, and I'd like to have some way to load
properties in a consistent way, perhaps ThisPage.properites, with overrides
taken from myclient.properties - kind of like locales, but not exactly.
For that matter, I might even do the same thing with ThisPage.html and
ThisPage.mynewclient.html files. I also have a few
MyApplication.properties. Perhaps I could refactor these (there aren't too
many) into some other organization?
Anyone have any tips for me in this regard? I don't anticipate any other
future locales other than default US, but I'd hate to break from convention
allowing for that if there's a better way.
I'm still on 1.3.7 btw, if that matters.
Thanks,
-- Jim.
On Fri, Jan 9, 2009 at 8:42 AM, Serkan Camurcuoglu <
Serkan.Camurcuoglu@telenity.com> wrote:
> I know this would be very difficult to create by hand, but if you
> automatically create a web.xml which includes 200 such filter definitions
> (replacing Application1 and dbfile1 with other values) I think that would do
> what you want. Note that here you obtain the db configuration file name as a
> filter init parameter, you should modify your application's init method
> accordingly..
>
> <filter>
> <filter-name>Application1</filter-name>
>
> <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
> <init-param>
> <param-name>applicationClassName</param-name>
> <param-value>com.mycompany.MyApplication</param-value>
> </init-param>
> <init-param>
> <param-name>dbFileName</param-name>
> <param-value>dbfile1.properties</param-value>
> </init-param>
> </filter>
>
> <filter-mapping>
> <filter-name>Application1</filter-name>
> <url-pattern>/dbfile1/*</url-pattern>
> <dispatcher>REQUEST</dispatcher>
> <dispatcher>INCLUDE</dispatcher>
> </filter-mapping>
>
>
>
>
> Sean W wrote:
>
>> path:
>> /ContextPath/wicket/BookmarkablePage
>>
>> It appears to me that using Wicket you cannot place anything in the path
>> between the context path and the mounted name except for "wicket", which
>> is
>> defined as your <url-pattern>. In other words, a mounted page cannot be
>> referenced from more than one path. This also means Wicket can't support
>> "sub contexts".
>>
>> Perhaps I'll have to try and deploy a single app 200 times in tomcat with
>> the same WAR. :-S
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Multiple Copies of One Wicket App
Posted by Serkan Camurcuoglu <Se...@telenity.com>.
I know this would be very difficult to create by hand, but if you
automatically create a web.xml which includes 200 such filter
definitions (replacing Application1 and dbfile1 with other values) I
think that would do what you want. Note that here you obtain the db
configuration file name as a filter init parameter, you should modify
your application's init method accordingly..
<filter>
<filter-name>Application1</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>com.mycompany.MyApplication</param-value>
</init-param>
<init-param>
<param-name>dbFileName</param-name>
<param-value>dbfile1.properties</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Application1</filter-name>
<url-pattern>/dbfile1/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
Sean W wrote:
> path:
> /ContextPath/wicket/BookmarkablePage
>
> It appears to me that using Wicket you cannot place anything in the path
> between the context path and the mounted name except for "wicket", which is
> defined as your <url-pattern>. In other words, a mounted page cannot be
> referenced from more than one path. This also means Wicket can't support
> "sub contexts".
>
> Perhaps I'll have to try and deploy a single app 200 times in tomcat with
> the same WAR. :-S
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Multiple Copies of One Wicket App
Posted by Sean W <se...@bibliofiche.com>.
path:
/ContextPath/wicket/BookmarkablePage
It appears to me that using Wicket you cannot place anything in the path
between the context path and the mounted name except for "wicket", which is
defined as your <url-pattern>. In other words, a mounted page cannot be
referenced from more than one path. This also means Wicket can't support
"sub contexts".
Perhaps I'll have to try and deploy a single app 200 times in tomcat with
the same WAR. :-S
--
View this message in context: http://www.nabble.com/Multiple-Copies-of-One-Wicket-App-tp21355510p21372369.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org