You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "oliver.stef" <ov...@gmail.com> on 2012/08/02 08:13:10 UTC

load properties file from extrnal path

Hi,

How can I load external properties file? (i mean that I don't want to load a
file that is in the regular wicket hierarchy where i have HelloWorld.java,
HelloWorld.html, HelloWorld.properties), what i want is to load file from-
C:\project\HelloWorld.properties. 

i tried to do this but wicket won't load the file.

any tips?

Thanks!




--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/load-properties-file-from-extrnal-path-tp4650944.html
Sent from the Users forum 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: load properties file from extrnal path

Posted by "oliver.stef" <ov...@gmail.com>.
Thanks Martin and Sandor!!
That was really helping!!!

I did it both - changed the Init() and added an external folder.
WORKS GREAT!!

Thanks again.
Oliver.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/load-properties-file-from-extrnal-path-tp4650944p4651007.html
Sent from the Users forum 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: load properties file from extrnal path

Posted by Sandor Feher <sf...@bluesystem.hu>.
Hi Oliver,

In your Application init add 
            
            IResourceSettings resourceSettings = getResourceSettings();
            resourceSettings.addResourceFolder("c:\project"); //this path
should be changed   


Regards., Sandor



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/load-properties-file-from-extrnal-path-tp4650944p4650955.html
Sent from the Users forum 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: load properties file from extrnal path

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

You need a custom implementation of
org.apache.wicket.resource.loader.IStringResourceLoader.
Check the default provided implementations for inspiration.

You can register it with: MyApp#init():
getResourceSettings().getStringResourceLoaders().add(0, new MyImpl())

On Thu, Aug 2, 2012 at 9:13 AM, oliver.stef <ov...@gmail.com> wrote:
> Hi,
>
> How can I load external properties file? (i mean that I don't want to load a
> file that is in the regular wicket hierarchy where i have HelloWorld.java,
> HelloWorld.html, HelloWorld.properties), what i want is to load file from-
> C:\project\HelloWorld.properties.
>
> i tried to do this but wicket won't load the file.
>
> any tips?
>
> Thanks!
>
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/load-properties-file-from-extrnal-path-tp4650944.html
> Sent from the Users forum 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
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org