You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Marieke Vandamme <ma...@tvh.be> on 2012/04/17 10:24:42 UTC

1.5 - getResourceSettings addResourceFolder - getResource

Dear, 

I'm converting a project from wicket 1.4 to wicket 1.5. 
Underneath worked in 1.4, but doesn't in 1.5. 

- In my application I add an additional resource folder:
  getResourceSettings().addResourceFolder("c:\\myfolder");
- I have a class ResourceGetter in com.test package.
- I'm trying to get "test.xml" from the filesystem doing the following:
  ResourceGetter.getClass().getResource("test.xml").
- This works when the "test.xml" is inside my project, but not when it's on
c:\myfolder\com\test\test.xml.

Is this a bug, or am I doing something wrong? Thanks in advance !

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/1-5-getResourceSettings-addResourceFolder-getResource-tp4563969p4563969.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: 1.5 - getResourceSettings addResourceFolder - getResource

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

ResourceGetter.getClass().getResource() has nothing to do with Wicket.
It will try to load the resource from the same folder where
ResourceGetter is.

By adding a custom folder with
getResourceSettings().addResourceFolder() you can later load from it
with org.apache.wicket.settings.IResourceSettings#getResourceFinder().find(Class,
String). The class argument may be null.

On Tue, Apr 17, 2012 at 11:24 AM, Marieke Vandamme
<ma...@tvh.be> wrote:
> Dear,
>
> I'm converting a project from wicket 1.4 to wicket 1.5.
> Underneath worked in 1.4, but doesn't in 1.5.
>
> - In my application I add an additional resource folder:
>  getResourceSettings().addResourceFolder("c:\\myfolder");
> - I have a class ResourceGetter in com.test package.
> - I'm trying to get "test.xml" from the filesystem doing the following:
>  ResourceGetter.getClass().getResource("test.xml").
> - This works when the "test.xml" is inside my project, but not when it's on
> c:\myfolder\com\test\test.xml.
>
> Is this a bug, or am I doing something wrong? Thanks in advance !
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/1-5-getResourceSettings-addResourceFolder-getResource-tp4563969p4563969.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