Igor, thanks for your excellent tipps.
> the application settings are meant there for you to configure wicket, > not your own application. If ApplicationSettings is not to store settings for your application, then I feel this name confusing. In the past years the name "webapp" referred to my own webapplication, not the underlying framework. > simply expose the properties in the application and then your > components can get them like this: > > MyApplication.get().getProperty("foo"); > > not so bad. Yes, but I need to expose my applications class to the components, which is not very generic and lets me create non-reusable stuff. However, it is possible for prototyping or trivial apps. > write a IComponentInstantiationListener and inject the properties, so > you can have > > @Properties Properties props; fields in your component that are > magically populated. This is great thanks. I will use this now. > there is no one way to do this, and its certainly not the job of the > UI layer to handle it for you. thus we do not do it. I understand there are hundreds of ways to go. But there should be at least one "standard" way. Configuration of a web app is so basic. Even UI frameworks need to be configured, at least when they are small (prototyping). There are thousand ways for doing i18n, but wicket has provided one way which can be extended. > as a last note, you can leverage wicket's i18n to load properties > stored in your MyApplication.properties. > getString("myproperty") is all you need. It feels a bit weird to use i18n for my configuration :-) But good to know :-) Cheers + thanks for the conversation, I have learned much of it. Christian > > -igor > > > On Sat, Jan 29, 2011 at 11:02 AM, Christian Grobmeier > <grobme...@gmail.com> wrote: >> On Sat, Jan 29, 2011 at 6:27 PM, Igor Vaynberg <igor.vaynb...@gmail.com> >> wrote: >>> that actually looks pretty simple to me... >> >> On first glance yes. But bringing the application parameters into >> another component or api will become complicated. >> >> WIth this code I can only extend my Application with a new method >> (getProperties). I have to introduce a new interface to make my >> components generic, otherwise I need casting. >> >> I looked at the ApplicationSettings and I am wondering why this class >> does not provide the functionality to set user defined parameters in >> key/value manner. Are there any reasons against this? I can imagine a >> loadUserProperties which does what I wrote below and stores the >> key/values in ApplicationSettings.getValue( String key) >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > -- http://www.grobmeier.de --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org