Re: Sessions and Activities and Places

2011-11-14 Thread Mike Dee
I'm sorry, I don't think I understand this.  How would a separate GWT
module help?  Wouldn't a separate module (with separate URL) produce a
separate session?

On Nov 13, 9:54 pm, -sowdri- sow...@gmail.com wrote:
 Have your tried moving login part to a separate GWT module, with a
 different url (consequently a separate host html) and let the container
 handle the session management?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Sessions and Activities and Places

2011-11-14 Thread Mike Dee
I think I've found a good way to handle this.  It really is pretty
easy.

I subclassed PlaceController and override it goTo() method.  It looks
like this:

public void goTo( Place newPlace )
{
if( isLoggedIn )
super.goTo( newPlace );
else
super.goTo( new LoginPlace() );
}

It seems to work well.  Handles pages that are bookmarked and the back
button.

On Nov 12, 5:43 pm, Mike Dee mdichiapp...@gmail.com wrote:
 What is a good way to have a GWT app redirect to a login screen when a
 session expires?  I've just hooked up a login page and a logout button
 at an Activities and Places app.  I basically handle this through the
 event bus with login and logout events (haven't hooked up a session
 time out yet).

 The events work nicely.  After logging in, the main place appears in
 the app.  When logging on, the login place appears.  Very nice.

 However, nothing prevents a user from accessing a place within the app
 - either by bookmarking or using the back button after logging out.
 I've experimented with a few things, but don't like any of them.  For
 example, in the AppActivityMapper if the user is not logged in, it
 goes to the login place regardless of the requested place.  I don't
 like this because the URL still shows the requested place.

 It looks like a central place to handle this is in
 PlaceController.goTo().  While looking at the source, it appears that
 changing places is handled via the event bus.

     String warning = maybeGoTo(newPlace);
     if (warning == null || delegate.confirm(warning)) {
       where = newPlace;
       eventBus.fireEvent(new PlaceChangeEvent(newPlace));

 Has anyone tried overriding this to handle loggin/logout?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Sessions and Activities and Places

2011-11-13 Thread Ashton Thomas
I handle this in two areas:

1) onModuleLoad: isAuthenticated/Valid Session 

2) 

-- 
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/-/T6HkY06Cz_gJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Sessions and Activities and Places

2011-11-13 Thread Ashton Thomas
I handle this in two areas:

1) onModuleLoad: isAuthenticated/Valid Session 

2) 

-- 
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/-/47RRkzwO8OEJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Sessions and Activities and Places

2011-11-13 Thread -sowdri-
Have your tried moving login part to a separate GWT module, with a 
different url (consequently a separate host html) and let the container 
handle the session management?

-- 
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/-/vd9ZItvamt0J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.