You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jim Pinkham <pi...@gmail.com> on 2010/02/25 20:14:05 UTC

Re: Multiple Copies of One Wicket App

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