You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by John Toncart <jo...@gmail.com> on 2011/12/07 07:58:12 UTC
WebApplication.get().getSharedResources.remove()
Hi folks,
in 1.4 I was doing (pseudo code, real code is longer):
public class MyPage extends WebPage
{
public MyPage()
{
...
DynamicImageResource image = new DynamicImageResource();
image.setImageData(_my_generated_byte_array_);
...
MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
MyApp.get().getSharedResources().add("/my/custom/resource_new",
image);
...
}
}
Not know if it's optimal but it works and resources are dynamicaly
mounted and dismounted.
In 1.5 I can't do:
MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
because remove() method in 1.5 needs "ResourceReference.Key"
Is there example how to work with remove() in 1.5 or how to rewrite
my code in example above?
Thanks,
JT
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: WebApplication.get().getSharedResources.remove()
Posted by Martin Grigorov <mg...@apache.org>.
Are you sure that StackOveflowError (SOE) happens ?
I can understand OutOfMemoryError in such case but not SOE.
On Wed, Dec 7, 2011 at 11:21 AM, John Toncart <jo...@gmail.com> wrote:
> Try put 20 images on page and display the page 1.000 times. If each
> image is 1MB in size I'm sure StackOverflow error will be raised. I have
> tested with memory set to 1GB in Tomcat and was produced. Profiling
> shows that problem lies in mounted images. Dismounting them after they
> have been shown on page resolved problem and Webapp runs with just
> around 300-400MB memory comsumption.
>
>
>
> Martin Grigorov wrote:
>>
>> On Wed, Dec 7, 2011 at 11:04 AM, John Toncart <jo...@gmail.com>
>> wrote:
>>>
>>> Dismounting: imagine webapp whith thousands generated images. from time
>>> to
>>> time
>>> each image is mounted (and displayed). If then wasn't dismounted, memory
>>> will be
>>> eated and stackoverflow error will be produced.
>>
>>
>> I don't see how StackOverflowError may happen.
>>
>> The problems I see are more memory consumption and longer time to
>> iterate over the mappings and find the one that matches.
>>
>>>
>>>
>>> vineet semwal wrote:
>>>>
>>>> can i ask why are you dismounting?
>>>>
>>>> create your resourcereference that returns your resource,use
>>>> resourcereference for mounting
>>>>
>>>> and Key key =new Key(your ResourceReference)
>>>>
>>>> you should also read a very nice martin-g's article on how to mount
>>>> resources in wicket 1.5
>>>>
>>>>
>>>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
>>>>
>>>> On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com>
>>>> wrote:
>>>>>
>>>>> Hi folks,
>>>>>
>>>>> in 1.4 I was doing (pseudo code, real code is longer):
>>>>>
>>>>> public class MyPage extends WebPage
>>>>> {
>>>>> public MyPage()
>>>>> {
>>>>> ...
>>>>> DynamicImageResource image = new DynamicImageResource();
>>>>> image.setImageData(_my_generated_byte_array_);
>>>>> ...
>>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>>> MyApp.get().getSharedResources().add("/my/custom/resource_new",
>>>>> image);
>>>>> ...
>>>>> }
>>>>> }
>>>>>
>>>>> Not know if it's optimal but it works and resources are dynamicaly
>>>>> mounted and dismounted.
>>>>>
>>>>> In 1.5 I can't do:
>>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>>> because remove() method in 1.5 needs "ResourceReference.Key"
>>>>>
>>>>> Is there example how to work with remove() in 1.5 or how to rewrite
>>>>> my code in example above?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> JT
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> 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
Re: WebApplication.get().getSharedResources.remove()
Posted by vineet semwal <vi...@gmail.com>.
correction i meant not much memory will be eaten in mounting and
maintaining that map..
On Wed, Dec 7, 2011 at 4:08 PM, vineet semwal
<vi...@gmail.com> wrote:
> i agree with martin..
> wicket only maintains concurrenthashpmap of key(ResourceRefrence.Key)
> and value (ResourceRefrence)
> both are very small objects so not much memory will be eaten in mounting as such
>
>
> your problem might lie in generating the resources..
>
> On Wed, Dec 7, 2011 at 3:51 PM, John Toncart <jo...@gmail.com> wrote:
>> Try put 20 images on page and display the page 1.000 times. If each
>> image is 1MB in size I'm sure StackOverflow error will be raised. I have
>> tested with memory set to 1GB in Tomcat and was produced. Profiling
>> shows that problem lies in mounted images. Dismounting them after they
>> have been shown on page resolved problem and Webapp runs with just
>> around 300-400MB memory comsumption.
>>
>>
>>
>> Martin Grigorov wrote:
>>>
>>> On Wed, Dec 7, 2011 at 11:04 AM, John Toncart <jo...@gmail.com>
>>> wrote:
>>>>
>>>> Dismounting: imagine webapp whith thousands generated images. from time
>>>> to
>>>> time
>>>> each image is mounted (and displayed). If then wasn't dismounted, memory
>>>> will be
>>>> eated and stackoverflow error will be produced.
>>>
>>>
>>> I don't see how StackOverflowError may happen.
>>>
>>> The problems I see are more memory consumption and longer time to
>>> iterate over the mappings and find the one that matches.
>>>
>>>>
>>>>
>>>> vineet semwal wrote:
>>>>>
>>>>> can i ask why are you dismounting?
>>>>>
>>>>> create your resourcereference that returns your resource,use
>>>>> resourcereference for mounting
>>>>>
>>>>> and Key key =new Key(your ResourceReference)
>>>>>
>>>>> you should also read a very nice martin-g's article on how to mount
>>>>> resources in wicket 1.5
>>>>>
>>>>>
>>>>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
>>>>>
>>>>> On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com>
>>>>> wrote:
>>>>>>
>>>>>> Hi folks,
>>>>>>
>>>>>> in 1.4 I was doing (pseudo code, real code is longer):
>>>>>>
>>>>>> public class MyPage extends WebPage
>>>>>> {
>>>>>> public MyPage()
>>>>>> {
>>>>>> ...
>>>>>> DynamicImageResource image = new DynamicImageResource();
>>>>>> image.setImageData(_my_generated_byte_array_);
>>>>>> ...
>>>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>>>> MyApp.get().getSharedResources().add("/my/custom/resource_new",
>>>>>> image);
>>>>>> ...
>>>>>> }
>>>>>> }
>>>>>>
>>>>>> Not know if it's optimal but it works and resources are dynamicaly
>>>>>> mounted and dismounted.
>>>>>>
>>>>>> In 1.5 I can't do:
>>>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>>>> because remove() method in 1.5 needs "ResourceReference.Key"
>>>>>>
>>>>>> Is there example how to work with remove() in 1.5 or how to rewrite
>>>>>> my code in example above?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> JT
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>>
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
> --
> thank you,
>
> regards,
> Vineet Semwal
--
thank you,
regards,
Vineet Semwal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: WebApplication.get().getSharedResources.remove()
Posted by vineet semwal <vi...@gmail.com>.
i agree with martin..
wicket only maintains concurrenthashpmap of key(ResourceRefrence.Key)
and value (ResourceRefrence)
both are very small objects so not much memory will be eaten in mounting as such
your problem might lie in generating the resources..
On Wed, Dec 7, 2011 at 3:51 PM, John Toncart <jo...@gmail.com> wrote:
> Try put 20 images on page and display the page 1.000 times. If each
> image is 1MB in size I'm sure StackOverflow error will be raised. I have
> tested with memory set to 1GB in Tomcat and was produced. Profiling
> shows that problem lies in mounted images. Dismounting them after they
> have been shown on page resolved problem and Webapp runs with just
> around 300-400MB memory comsumption.
>
>
>
> Martin Grigorov wrote:
>>
>> On Wed, Dec 7, 2011 at 11:04 AM, John Toncart <jo...@gmail.com>
>> wrote:
>>>
>>> Dismounting: imagine webapp whith thousands generated images. from time
>>> to
>>> time
>>> each image is mounted (and displayed). If then wasn't dismounted, memory
>>> will be
>>> eated and stackoverflow error will be produced.
>>
>>
>> I don't see how StackOverflowError may happen.
>>
>> The problems I see are more memory consumption and longer time to
>> iterate over the mappings and find the one that matches.
>>
>>>
>>>
>>> vineet semwal wrote:
>>>>
>>>> can i ask why are you dismounting?
>>>>
>>>> create your resourcereference that returns your resource,use
>>>> resourcereference for mounting
>>>>
>>>> and Key key =new Key(your ResourceReference)
>>>>
>>>> you should also read a very nice martin-g's article on how to mount
>>>> resources in wicket 1.5
>>>>
>>>>
>>>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
>>>>
>>>> On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com>
>>>> wrote:
>>>>>
>>>>> Hi folks,
>>>>>
>>>>> in 1.4 I was doing (pseudo code, real code is longer):
>>>>>
>>>>> public class MyPage extends WebPage
>>>>> {
>>>>> public MyPage()
>>>>> {
>>>>> ...
>>>>> DynamicImageResource image = new DynamicImageResource();
>>>>> image.setImageData(_my_generated_byte_array_);
>>>>> ...
>>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>>> MyApp.get().getSharedResources().add("/my/custom/resource_new",
>>>>> image);
>>>>> ...
>>>>> }
>>>>> }
>>>>>
>>>>> Not know if it's optimal but it works and resources are dynamicaly
>>>>> mounted and dismounted.
>>>>>
>>>>> In 1.5 I can't do:
>>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>>> because remove() method in 1.5 needs "ResourceReference.Key"
>>>>>
>>>>> Is there example how to work with remove() in 1.5 or how to rewrite
>>>>> my code in example above?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> JT
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
--
thank you,
regards,
Vineet Semwal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: WebApplication.get().getSharedResources.remove()
Posted by John Toncart <jo...@gmail.com>.
Try put 20 images on page and display the page 1.000 times. If each
image is 1MB in size I'm sure StackOverflow error will be raised. I have
tested with memory set to 1GB in Tomcat and was produced. Profiling
shows that problem lies in mounted images. Dismounting them after they
have been shown on page resolved problem and Webapp runs with just
around 300-400MB memory comsumption.
Martin Grigorov wrote:
> On Wed, Dec 7, 2011 at 11:04 AM, John Toncart <jo...@gmail.com> wrote:
>> Dismounting: imagine webapp whith thousands generated images. from time to
>> time
>> each image is mounted (and displayed). If then wasn't dismounted, memory
>> will be
>> eated and stackoverflow error will be produced.
>
> I don't see how StackOverflowError may happen.
>
> The problems I see are more memory consumption and longer time to
> iterate over the mappings and find the one that matches.
>
>>
>>
>> vineet semwal wrote:
>>> can i ask why are you dismounting?
>>>
>>> create your resourcereference that returns your resource,use
>>> resourcereference for mounting
>>>
>>> and Key key =new Key(your ResourceReference)
>>>
>>> you should also read a very nice martin-g's article on how to mount
>>> resources in wicket 1.5
>>>
>>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
>>>
>>> On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com>
>>> wrote:
>>>> Hi folks,
>>>>
>>>> in 1.4 I was doing (pseudo code, real code is longer):
>>>>
>>>> public class MyPage extends WebPage
>>>> {
>>>> public MyPage()
>>>> {
>>>> ...
>>>> DynamicImageResource image = new DynamicImageResource();
>>>> image.setImageData(_my_generated_byte_array_);
>>>> ...
>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>> MyApp.get().getSharedResources().add("/my/custom/resource_new",
>>>> image);
>>>> ...
>>>> }
>>>> }
>>>>
>>>> Not know if it's optimal but it works and resources are dynamicaly
>>>> mounted and dismounted.
>>>>
>>>> In 1.5 I can't do:
>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>> because remove() method in 1.5 needs "ResourceReference.Key"
>>>>
>>>> Is there example how to work with remove() in 1.5 or how to rewrite
>>>> my code in example above?
>>>>
>>>> Thanks,
>>>>
>>>> JT
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: WebApplication.get().getSharedResources.remove()
Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Dec 7, 2011 at 11:04 AM, John Toncart <jo...@gmail.com> wrote:
> Dismounting: imagine webapp whith thousands generated images. from time to
> time
> each image is mounted (and displayed). If then wasn't dismounted, memory
> will be
> eated and stackoverflow error will be produced.
I don't see how StackOverflowError may happen.
The problems I see are more memory consumption and longer time to
iterate over the mappings and find the one that matches.
>
>
>
> vineet semwal wrote:
>>
>> can i ask why are you dismounting?
>>
>> create your resourcereference that returns your resource,use
>> resourcereference for mounting
>>
>> and Key key =new Key(your ResourceReference)
>>
>> you should also read a very nice martin-g's article on how to mount
>> resources in wicket 1.5
>>
>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
>>
>> On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com>
>> wrote:
>>>
>>> Hi folks,
>>>
>>> in 1.4 I was doing (pseudo code, real code is longer):
>>>
>>> public class MyPage extends WebPage
>>> {
>>> public MyPage()
>>> {
>>> ...
>>> DynamicImageResource image = new DynamicImageResource();
>>> image.setImageData(_my_generated_byte_array_);
>>> ...
>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>> MyApp.get().getSharedResources().add("/my/custom/resource_new",
>>> image);
>>> ...
>>> }
>>> }
>>>
>>> Not know if it's optimal but it works and resources are dynamicaly
>>> mounted and dismounted.
>>>
>>> In 1.5 I can't do:
>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>> because remove() method in 1.5 needs "ResourceReference.Key"
>>>
>>> Is there example how to work with remove() in 1.5 or how to rewrite
>>> my code in example above?
>>>
>>> Thanks,
>>>
>>> JT
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> 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
Re: WebApplication.get().getSharedResources.remove()
Posted by John Toncart <jo...@gmail.com>.
Dismounting: imagine webapp whith thousands generated images. from time to time
each image is mounted (and displayed). If then wasn't dismounted, memory will be
eated and stackoverflow error will be produced.
vineet semwal wrote:
> can i ask why are you dismounting?
>
> create your resourcereference that returns your resource,use
> resourcereference for mounting
>
> and Key key =new Key(your ResourceReference)
>
> you should also read a very nice martin-g's article on how to mount
> resources in wicket 1.5
> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
>
> On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com> wrote:
>> Hi folks,
>>
>> in 1.4 I was doing (pseudo code, real code is longer):
>>
>> public class MyPage extends WebPage
>> {
>> public MyPage()
>> {
>> ...
>> DynamicImageResource image = new DynamicImageResource();
>> image.setImageData(_my_generated_byte_array_);
>> ...
>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>> MyApp.get().getSharedResources().add("/my/custom/resource_new",
>> image);
>> ...
>> }
>> }
>>
>> Not know if it's optimal but it works and resources are dynamicaly
>> mounted and dismounted.
>>
>> In 1.5 I can't do:
>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>> because remove() method in 1.5 needs "ResourceReference.Key"
>>
>> Is there example how to work with remove() in 1.5 or how to rewrite
>> my code in example above?
>>
>> Thanks,
>>
>> JT
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: WebApplication.get().getSharedResources.remove()
Posted by vineet semwal <vi...@gmail.com>.
thanks created one https://issues.apache.org/jira/browse/WICKET-4284
On Wed, Dec 7, 2011 at 2:26 PM, Martin Grigorov <mg...@apache.org> wrote:
> Use Jira ;-)
>
> On Wed, Dec 7, 2011 at 9:55 AM, vineet semwal
> <vi...@gmail.com> wrote:
>> hi martin,
>> thanks for the explanation..
>> i think getkey() in ResourceReference should be public ..
>>
>> On Wed, Dec 7, 2011 at 1:52 PM, Martin Grigorov <mg...@apache.org> wrote:
>>> Hi,
>>>
>>> Unmounting may be needed for example in OSGi environment where bundles
>>> are dynamically deployed/undeployed.
>>>
>>> The new API is:
>>> Key key = new Key("your/path/to/the/image.png");
>>> #remove(key);
>>>
>>> Key is a complex primary key that consists of: name (String), scope
>>> (Class), locale (Locale), variation (String), style (String).
>>> Most of these can be null. In your case you use just 'name' and scope
>>> will fallback to default o.a.w.Application.
>>>
>>> On Wed, Dec 7, 2011 at 8:42 AM, vineet semwal
>>> <vi...@gmail.com> wrote:
>>>> can i ask why are you dismounting?
>>>>
>>>> create your resourcereference that returns your resource,use
>>>> resourcereference for mounting
>>>>
>>>> and Key key =new Key(your ResourceReference)
>>>>
>>>> you should also read a very nice martin-g's article on how to mount
>>>> resources in wicket 1.5
>>>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
>>>>
>>>> On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com> wrote:
>>>>> Hi folks,
>>>>>
>>>>> in 1.4 I was doing (pseudo code, real code is longer):
>>>>>
>>>>> public class MyPage extends WebPage
>>>>> {
>>>>> public MyPage()
>>>>> {
>>>>> ...
>>>>> DynamicImageResource image = new DynamicImageResource();
>>>>> image.setImageData(_my_generated_byte_array_);
>>>>> ...
>>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>>> MyApp.get().getSharedResources().add("/my/custom/resource_new",
>>>>> image);
>>>>> ...
>>>>> }
>>>>> }
>>>>>
>>>>> Not know if it's optimal but it works and resources are dynamicaly
>>>>> mounted and dismounted.
>>>>>
>>>>> In 1.5 I can't do:
>>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>>> because remove() method in 1.5 needs "ResourceReference.Key"
>>>>>
>>>>> Is there example how to work with remove() in 1.5 or how to rewrite
>>>>> my code in example above?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> JT
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> thank you,
>>>>
>>>> regards,
>>>> Vineet Semwal
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>>
>>
>>
>>
>> --
>> thank you,
>>
>> regards,
>> Vineet Semwal
>>
>> ---------------------------------------------------------------------
>> 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
>
--
thank you,
regards,
Vineet Semwal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: WebApplication.get().getSharedResources.remove()
Posted by Martin Grigorov <mg...@apache.org>.
Use Jira ;-)
On Wed, Dec 7, 2011 at 9:55 AM, vineet semwal
<vi...@gmail.com> wrote:
> hi martin,
> thanks for the explanation..
> i think getkey() in ResourceReference should be public ..
>
> On Wed, Dec 7, 2011 at 1:52 PM, Martin Grigorov <mg...@apache.org> wrote:
>> Hi,
>>
>> Unmounting may be needed for example in OSGi environment where bundles
>> are dynamically deployed/undeployed.
>>
>> The new API is:
>> Key key = new Key("your/path/to/the/image.png");
>> #remove(key);
>>
>> Key is a complex primary key that consists of: name (String), scope
>> (Class), locale (Locale), variation (String), style (String).
>> Most of these can be null. In your case you use just 'name' and scope
>> will fallback to default o.a.w.Application.
>>
>> On Wed, Dec 7, 2011 at 8:42 AM, vineet semwal
>> <vi...@gmail.com> wrote:
>>> can i ask why are you dismounting?
>>>
>>> create your resourcereference that returns your resource,use
>>> resourcereference for mounting
>>>
>>> and Key key =new Key(your ResourceReference)
>>>
>>> you should also read a very nice martin-g's article on how to mount
>>> resources in wicket 1.5
>>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
>>>
>>> On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com> wrote:
>>>> Hi folks,
>>>>
>>>> in 1.4 I was doing (pseudo code, real code is longer):
>>>>
>>>> public class MyPage extends WebPage
>>>> {
>>>> public MyPage()
>>>> {
>>>> ...
>>>> DynamicImageResource image = new DynamicImageResource();
>>>> image.setImageData(_my_generated_byte_array_);
>>>> ...
>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>> MyApp.get().getSharedResources().add("/my/custom/resource_new",
>>>> image);
>>>> ...
>>>> }
>>>> }
>>>>
>>>> Not know if it's optimal but it works and resources are dynamicaly
>>>> mounted and dismounted.
>>>>
>>>> In 1.5 I can't do:
>>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>>> because remove() method in 1.5 needs "ResourceReference.Key"
>>>>
>>>> Is there example how to work with remove() in 1.5 or how to rewrite
>>>> my code in example above?
>>>>
>>>> Thanks,
>>>>
>>>> JT
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>>
>>>
>>>
>>>
>>> --
>>> thank you,
>>>
>>> regards,
>>> Vineet Semwal
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>
>
>
> --
> thank you,
>
> regards,
> Vineet Semwal
>
> ---------------------------------------------------------------------
> 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
Re: WebApplication.get().getSharedResources.remove()
Posted by vineet semwal <vi...@gmail.com>.
hi martin,
thanks for the explanation..
i think getkey() in ResourceReference should be public ..
On Wed, Dec 7, 2011 at 1:52 PM, Martin Grigorov <mg...@apache.org> wrote:
> Hi,
>
> Unmounting may be needed for example in OSGi environment where bundles
> are dynamically deployed/undeployed.
>
> The new API is:
> Key key = new Key("your/path/to/the/image.png");
> #remove(key);
>
> Key is a complex primary key that consists of: name (String), scope
> (Class), locale (Locale), variation (String), style (String).
> Most of these can be null. In your case you use just 'name' and scope
> will fallback to default o.a.w.Application.
>
> On Wed, Dec 7, 2011 at 8:42 AM, vineet semwal
> <vi...@gmail.com> wrote:
>> can i ask why are you dismounting?
>>
>> create your resourcereference that returns your resource,use
>> resourcereference for mounting
>>
>> and Key key =new Key(your ResourceReference)
>>
>> you should also read a very nice martin-g's article on how to mount
>> resources in wicket 1.5
>> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
>>
>> On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com> wrote:
>>> Hi folks,
>>>
>>> in 1.4 I was doing (pseudo code, real code is longer):
>>>
>>> public class MyPage extends WebPage
>>> {
>>> public MyPage()
>>> {
>>> ...
>>> DynamicImageResource image = new DynamicImageResource();
>>> image.setImageData(_my_generated_byte_array_);
>>> ...
>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>> MyApp.get().getSharedResources().add("/my/custom/resource_new",
>>> image);
>>> ...
>>> }
>>> }
>>>
>>> Not know if it's optimal but it works and resources are dynamicaly
>>> mounted and dismounted.
>>>
>>> In 1.5 I can't do:
>>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>>> because remove() method in 1.5 needs "ResourceReference.Key"
>>>
>>> Is there example how to work with remove() in 1.5 or how to rewrite
>>> my code in example above?
>>>
>>> Thanks,
>>>
>>> JT
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>
>>
>>
>> --
>> thank you,
>>
>> regards,
>> Vineet Semwal
>>
>> ---------------------------------------------------------------------
>> 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
>
--
thank you,
regards,
Vineet Semwal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: WebApplication.get().getSharedResources.remove()
Posted by Martin Grigorov <mg...@apache.org>.
Hi,
Unmounting may be needed for example in OSGi environment where bundles
are dynamically deployed/undeployed.
The new API is:
Key key = new Key("your/path/to/the/image.png");
#remove(key);
Key is a complex primary key that consists of: name (String), scope
(Class), locale (Locale), variation (String), style (String).
Most of these can be null. In your case you use just 'name' and scope
will fallback to default o.a.w.Application.
On Wed, Dec 7, 2011 at 8:42 AM, vineet semwal
<vi...@gmail.com> wrote:
> can i ask why are you dismounting?
>
> create your resourcereference that returns your resource,use
> resourcereference for mounting
>
> and Key key =new Key(your ResourceReference)
>
> you should also read a very nice martin-g's article on how to mount
> resources in wicket 1.5
> http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
>
> On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com> wrote:
>> Hi folks,
>>
>> in 1.4 I was doing (pseudo code, real code is longer):
>>
>> public class MyPage extends WebPage
>> {
>> public MyPage()
>> {
>> ...
>> DynamicImageResource image = new DynamicImageResource();
>> image.setImageData(_my_generated_byte_array_);
>> ...
>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>> MyApp.get().getSharedResources().add("/my/custom/resource_new",
>> image);
>> ...
>> }
>> }
>>
>> Not know if it's optimal but it works and resources are dynamicaly
>> mounted and dismounted.
>>
>> In 1.5 I can't do:
>> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
>> because remove() method in 1.5 needs "ResourceReference.Key"
>>
>> Is there example how to work with remove() in 1.5 or how to rewrite
>> my code in example above?
>>
>> Thanks,
>>
>> JT
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>
>
> --
> thank you,
>
> regards,
> Vineet Semwal
>
> ---------------------------------------------------------------------
> 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
Re: WebApplication.get().getSharedResources.remove()
Posted by vineet semwal <vi...@gmail.com>.
can i ask why are you dismounting?
create your resourcereference that returns your resource,use
resourcereference for mounting
and Key key =new Key(your ResourceReference)
you should also read a very nice martin-g's article on how to mount
resources in wicket 1.5
http://wicketinaction.com/2011/07/wicket-1-5-mounting-resources/comment-page-1/
On Wed, Dec 7, 2011 at 12:28 PM, John Toncart <jo...@gmail.com> wrote:
> Hi folks,
>
> in 1.4 I was doing (pseudo code, real code is longer):
>
> public class MyPage extends WebPage
> {
> public MyPage()
> {
> ...
> DynamicImageResource image = new DynamicImageResource();
> image.setImageData(_my_generated_byte_array_);
> ...
> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
> MyApp.get().getSharedResources().add("/my/custom/resource_new",
> image);
> ...
> }
> }
>
> Not know if it's optimal but it works and resources are dynamicaly
> mounted and dismounted.
>
> In 1.5 I can't do:
> MyApp.get().getSharedResources().remove("/my/custom/resource.jpg");
> because remove() method in 1.5 needs "ResourceReference.Key"
>
> Is there example how to work with remove() in 1.5 or how to rewrite
> my code in example above?
>
> Thanks,
>
> JT
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
--
thank you,
regards,
Vineet Semwal
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org