The problem with jumping ahead of the RemoteServiceServlet for your
authentication is that you don't have a good way to communicate to GWT
that there was an authentication exception.
I tend to do my JAAS login inside the RemoteServiceServlet where I can
throw a checked AuthenticationException which I can in turn handle
gracefully on the client side.
consider this scenario:
User loads a rather large cash worksheet that he needs to fill, the
user begins filling the worksheet, then takes a break, and returns to
complete the worksheet. This user then submits the completed worksheet.
Now, with the previously mentioned technique, the session is checked
before the request is deserialized and the server notices that the
session has expired, and throws an authentication exception. The
client recieves that exception in the onFailure() method of the
callback and takes appropriate action to have the user reauthenticate.
once that process is successful, the client application can resubmit
the original request, and the user has not lost any of his work.
If you use the default form based the world just stops, the user is
forced to reauthenticate outside the scope of the application, and his
progress is lost. This really aggravates customers by the way.
-jason