You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Rakesh A <ia...@rediffmail.com> on 2016/10/13 04:36:33 UTC

Possibility of mounting Wicket resource accessible only once

Hi,

Is it possible to mount a resource programmatically (Eg. On click of an
AjaxLink), and make it available only once ?

I looked into dynamic resources concept of having a mounted resource, which
uses URL attributes to decide which resource content to return from
getResource() method of it.

In my case, URL remains the same but what to return from getResource() is
decided based on the context when user clicks on an AjaxLink.

Any pointers how to implement it ?

Regards,
Rakesh.A

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Possibility-of-mounting-Wicket-resource-accessible-only-once-tp4675749.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: Possibility of mounting Wicket resource accessible only once

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Questions...

1- What happens with mounted URLS not visited (stay in memory as far as I
can see)
2- What happens after server restarts (guessing they disappear)

On Thu, Oct 13, 2016 at 9:16 AM, Rakesh A <ia...@rediffmail.com>
wrote:

> Hi,
>
> URLs I can add some code to make them unique, and unmounting from
> #getResource() seems better place indeed.
>
> Thank you for the inputs.
>
> Regards,
> Rakesh.A
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Possibility-of-mounting-Wicket-resource-
> accessible-only-once-tp4675749p4675753.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
>
>


-- 
Regards - Ernesto Reinaldo Barreiro

Re: Possibility of mounting Wicket resource accessible only once

Posted by Rakesh A <ia...@rediffmail.com>.
Hi,

URLs I can add some code to make them unique, and unmounting from
#getResource() seems better place indeed.

Thank you for the inputs.

Regards,
Rakesh.A

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Possibility-of-mounting-Wicket-resource-accessible-only-once-tp4675749p4675753.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: Possibility of mounting Wicket resource accessible only once

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

On Thu, Oct 13, 2016 at 8:38 AM, Rakesh A <ia...@rediffmail.com>
wrote:

> Hi,
>
> Having the token persisted into DB seems bit complex to solve this
> 'dynamic'
> resource issue.
>
> The way I've implemented it right now, is to have this resource reference
> unmounted, from AbstractRequestCycleListener#onRequestHandlerExecuted()
> method, where I've access to IRequestHandler and the resource reference
> object it self (checking for ResourceReferenceRequestHandler)
>
> Do you see any issues with this approach ?
>

One issue could be that later you mount again another resource(reference)
on the same path and this is against your initial requirement. I also
thought about storing tokens in some persistent storage like Ernesto. But
you know your requirements better!

You can do the unmounting in ResourceReference#getResource() method too.
There you know for sure that this is the temporary resref that should be
unmounted.


>
> Regards,
> Rakesh.A
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Possibility-of-mounting-Wicket-resource-
> accessible-only-once-tp4675749p4675751.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: Possibility of mounting Wicket resource accessible only once

Posted by Rakesh A <ia...@rediffmail.com>.
Hi,

Having the token persisted into DB seems bit complex to solve this 'dynamic'
resource issue.

The way I've implemented it right now, is to have this resource reference
unmounted, from AbstractRequestCycleListener#onRequestHandlerExecuted()
method, where I've access to IRequestHandler and the resource reference
object it self (checking for ResourceReferenceRequestHandler)

Do you see any issues with this approach ?

Regards,
Rakesh.A

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Possibility-of-mounting-Wicket-resource-accessible-only-once-tp4675749p4675751.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: Possibility of mounting Wicket resource accessible only once

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Hi,

you can mount a resource like

"willdisapear/${token}"

you create a "table" tonkens... and add an element when users clicks. e.g.
"xxyyxxxooq". One user visit this url you delete token  and URl is no
longer there.


On Thu, Oct 13, 2016 at 6:36 AM, Rakesh A <ia...@rediffmail.com>
wrote:

> Hi,
>
> Is it possible to mount a resource programmatically (Eg. On click of an
> AjaxLink), and make it available only once ?
>
> I looked into dynamic resources concept of having a mounted resource, which
> uses URL attributes to decide which resource content to return from
> getResource() method of it.
>
> In my case, URL remains the same but what to return from getResource() is
> decided based on the context when user clicks on an AjaxLink.
>
> Any pointers how to implement it ?
>
> Regards,
> Rakesh.A
>
> --
> View this message in context: http://apache-wicket.1842946.
> n4.nabble.com/Possibility-of-mounting-Wicket-resource-
> accessible-only-once-tp4675749.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
>
>


-- 
Regards - Ernesto Reinaldo Barreiro