We have an existing application which is developed in GWT (1.2)
framework.I want to have an authentication check at a central location
within the application and redirect the user to the login page if he/
she is not authenticated.
The solution that i tried for this is to have a ServletFilter, which
would check the user principal and do a response.sendRedirect() if the
user is not authenticated. But unfortunetly this does not work. I
think this is due to the Ajax based nature of the GWT framework. But i
would appreciate if some one would throw some more light on why
response.sendRedirect does not work in GWT framework.
Another thing i was looking for is if we cannot use
response.sendredirect() with GWT, what could be another approach that
can be used for the above usecase.
Thanks and Regards,
Vicky
The response of an ajax call is just text. Its up your code to do
something with it.
It just doesnt ever make sense to send redirect to a gwt rpc request.
Throw an exception on the client to say the client has failed to
authenticate and handle the exception, show them an alert and prompt
them with a modal dialog box for their name/passs.