You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Henrique <qu...@gmail.com> on 2010/11/08 02:39:37 UTC

Temporary storage of objects

Hello, what is the best way to temporarily store objects while I need
the user to perform other tasks?

For example, say the user has entered in a form some data needed to
publish something to a website but before he can do that, he has to be
redirected to a login page and login before this data can be stored in
the database.

I'm not sure what would be the most efficient/safe way to do this.
I've seen examples where this data is passed around in the URL (GET),
temporarily storing it in a database, attaching it to the current
Session, etc.

Any suggestion is appreciated. Thanks!

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


Re: Temporary storage of objects

Posted by Jeremy Thomerson <je...@wickettraining.com>.
On Sun, Nov 7, 2010 at 7:39 PM, Henrique <qu...@gmail.com> wrote:

> Hello, what is the best way to temporarily store objects while I need
> the user to perform other tasks?
>
> For example, say the user has entered in a form some data needed to
> publish something to a website but before he can do that, he has to be
> redirected to a login page and login before this data can be stored in
> the database.
>
> I'm not sure what would be the most efficient/safe way to do this.
> I've seen examples where this data is passed around in the URL (GET),
> temporarily storing it in a database, attaching it to the current
> Session, etc.
>
> Any suggestion is appreciated. Thanks!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
If you're storing it in a model or a field on the page (since you can't use
a loadable detachable model for a transient instance), you can simply
redirect back to that exact instance of that page.  And, if you are using
the normal security mechanism, you should be able to follow this very easy
flow:

   - display stateful page with editable object stored as field or in page's
   model
   - user clicks onsubmit, your security implementation realizes they
   haven't authenticated, but need to, and it redirects to login page
   - they login, and in onSubmit of your login form, you use
   continueToOriginalDestination()
   - they should end up back on the same flow they were, with all data still
   there



-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*