GWT Application Login/Logout

783 views
Skip to first unread message

katam...@gmail.com

unread,
Dec 27, 2010, 2:01:52 AM12/27/10
to Google Web Toolkit
Hi,

I am developing RIA with GWT frame work which is built using MVP
architecture [Views, Places, Activities & model]. This application
include login page, main page and logout page etc.. Each page is made
as a view and these pages are shown by using activities. At server, i
am using RPC services to send the data to client. I have few queries
regarding the GWT MVP pattern.

1. How to delete the view objects in main page, when user logout from
the application?
i.e. when user login and open some tabs and logout without closing the
tabs in the main page. Next time if any user login again in the same
browser, then the tabs in the main page are still opened and its
showing the same main page view with tabs open.
I want to create the view objects each time when user login (delete
the history views when user logout).

2. How to redirect to login view when session times out in the server?

3. I am using views, places & activities at client side to show
different pages in the browser using MVP pattern. Is it best way to
design GWT applications?

Regards,
Pavan

nacho

unread,
Dec 28, 2010, 10:24:08 PM12/28/10
to Google Web Toolkit


On 27 dic, 04:01, "katampa...@gmail.com" <katampa...@gmail.com> wrote:
> Hi,
>
>       I am developing RIA with GWT frame work which is built using MVP
> architecture [Views, Places, Activities & model]. This application
> include login page, main page and logout page etc.. Each page is made
> as a view and these pages are shown by using activities. At server, i
> am using RPC services to send the data to client. I have few queries
> regarding the GWT MVP pattern.
>
> 1. How to delete the view objects in main page, when user logout from
> the application?

Are you downloading all the code in the same page? I mean, dispite the
user is logued or not you are downloading the code for your tabs and
your services, etc? Why don't you use 2 pages? login.html and
logued.html?

If you still want to delete widgets from the page try with
RootPanel.get(ID).remove(IsWidget child);

> i.e. when user login and open some tabs and logout without closing the
> tabs in the main page. Next time if any user login again in the same
> browser, then the tabs in the main page are still opened and its
> showing the same main page view with tabs open.
> I want to create the view objects each time when user login (delete
> the history views when user logout).
>
> 2. How to redirect to login view when session times out in the server?

Validate the session and then Window.Location.assign('/login.html');

>
> 3. I am using views, places & activities at client side to show
> different pages in the browser using MVP pattern. Is it best way to
> design GWT applications?
>

I dont't know if this is the best way, but it works nice for me.

> Regards,
> Pavan
Reply all
Reply to author
Forward
0 new messages