remember places

22 views
Skip to first unread message

Fabricio Pizzichillo

unread,
Sep 15, 2011, 12:12:04 PM9/15/11
to google-we...@googlegroups.com
hello to the group
I am developing an application, and I need at the time of requesting the login,remember that place comes the request, so you can continue browsing where you were
How do I remember the place where I come from?


greetings and thanks!

Alex Dobjanschi

unread,
Sep 15, 2011, 1:07:44 PM9/15/11
to google-we...@googlegroups.com
Your login place should have a 'redirectAfterLogin' String member, like this:

class LoginPlace extends Place {
 String redirectAfterLogin;
}

Optionally, you could go for, this is closely bound to GWT specific implementation:

class LoginPlace extends Place {
  Place redirectAfterLogin;
}

Fabricio Pizzichillo

unread,
Sep 15, 2011, 1:50:20 PM9/15/11
to google-we...@googlegroups.com
Thanks Alex! 

2011/9/15 Alex Dobjanschi <alex.do...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/s-Oxx0HYzzAJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

BM

unread,
Sep 16, 2011, 4:48:00 PM9/16/11
to Google Web Toolkit
Will it still work if you refresh the browser (F5 key) or just jump up
the places by Back button? I think redirectAfterLogin may be null in
those cases as they are not set via previous activity class.



On Sep 15, 12:07 pm, Alex Dobjanschi <alex.dobjans...@gmail.com>
wrote:

-sowdri-

unread,
Sep 16, 2011, 11:52:34 PM9/16/11
to google-we...@googlegroups.com
While a Place can hold any data structure, including other places, as you said once you refresh the browser, the data is lost. 

To circumvent this, Place must be considered to be a special kind of object in GWT, such that, the state of the place must be represented as part of url.  This is the reason for having a PlaceTokenizer. So in spite of having a reference to the toBeRedirectedPlace, you must also have a url param redirectTo=<xxx>, from which you can reconstruct the place on browser refresh. 

Hope this helps!
Reply all
Reply to author
Forward
0 new messages