that actually looks pretty simple to me...

-igor

On Sat, Jan 29, 2011 at 8:17 AM, Christian Grobmeier
<grobme...@gmail.com> wrote:
> Hello
>
> I tried to figure out how one can load own configuration files into
> wicket, for example with configuration on smtp host or something like
> that.
>
> It seems there is no standard way- is this correct? My solution is
> below, but it feels rather overcomplicated to me.
> I have overridden the init method and used the PropertiesFactory to
> load my own properties file into a member variable of my application
> class. I want my properties be available as long as the application
> lives (application scope) and accessible from various components.
>
> If you know any ways to make this easier, please let me know.
>
> Thanks
> Christian
>
>
>
> In my WebApplication class:
>
>        @Override
>        public void init() {
> ...
>  PropertiesFactory properties = new PropertiesFactory(this);
>            String configFile = "WEB-INF/config-deployment.";
>            
> if(RuntimeConfigurationType.DEVELOPMENT.equals(this.getConfigurationType()))
> {
>                configFile = "WEB-INF/config-development.";
>            }
>            Properties p = properties.load(TimeAndBillApplication.class, 
> configFile);
>            if(p != null) {
>                applicationProperties = new
> Properties("applicationProperties", p.getAll());
>            }
>
> ---------------------------------------------------------------------
> 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

Reply via email to