Help! I tried to make a Logout link and it keeps taking to /UIDL.

I’m creating an application that uses the the Google App Engine login functionality with UserService.createLoginURL()…etc.

It’s able to create proper login URLs that work when I click on them. But when I use UserService.createLogoutURL()… with the same method:

linkLogout.setResource(new ExternalResource(userService.createLogoutURL(request.getRequestedURI()));

then when I click this link in the app, it takes me to:

and shows me all this UIDL code.

Then my app is completely broken with no way to recover other than the back button or reloading it back to localhost:8888.

Does anyone know why the link is creating this UIDL broken link and how to fix it??

I have to say I have no idea what you are doing, but it could that I’ve noted when I use the request object’s path as part of my builders, I generally have to use URLs that take me “up one directory level” to get to my context path’s root, so if my login page is /contextpath/login.jsp, you may want to define the page as “…/login.jsp” rather than “login.jsp” or “./login.jsp” as the UIDL is generally handled by the vaadin path.

That might not be the issue here, but in case you are using Vaadin 6.4.9, upgrade to either 6.4.10 or 6.5.x - there was a bug in 6.4.9 that does cause the UIDL URL to be treated incorrectly in certain cases.

If that is not the problem, check what UserService.createLogoutURL() does - the request your servlet is processing here is actually an asynchronous UIDL request, and the UIDL page is not a good logout page but you should point to the “root” of the servlet context path.

Thanks all. I don’t have much time to respond to individual answers as I’m working on a tight deadline but will respond back later.

Long story short, I did have to change the link location from “getRequestedURI()” to “/”, and now it works, as someone suggested. Sorry my question was a bit confusing. ttyl