0

My GAE java based application uses only one google user - the admin. For the admin web pages I generate the logout url using

UserServiceFactory.getUserService().createLogoutURL("/")

The generated url is always having a /zero at the end and clicking on it gives 'Error 404 NOT_FOUND'.

I The problem occurs on development server as well as the cloud. On dev server, this generated url is always looking like - http://localhost:8080/myapp/myurl/0 and when actually deployed on cloud it is similar http://myapp.appspot.com/myapp/myurl/0

I wonder why logout url generated is not working, is it something I am doing wrong or missing some configuration ? please help.

Gopi
  • 10,073
  • 4
  • 31
  • 45

2 Answers2

2

Check your web.xml. You have to add following section.

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

You can replace index.jsp with your choice.

Edit

I don't know what is wrong with your app. Here is a test app i have created.

http://rqtest123.appspot.com/

My web.xml look like

<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">

        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
</web-app>

I think you shoul check your web.xml again.

Manjoor
  • 4,091
  • 10
  • 43
  • 67
  • Its already there in my web.xml. The exact error I get is "HTTP ERROR 404 Problem accessing /myapp/myurl/0. Reason: NOT_FOUND" – Gopi Jul 21 '10 at 06:51
  • Hey thanks for your efforts. I notice the logout url in your page as 'http://rqtest123.appspot.com/_ah/logout?continue=https://www.google.com/accounts/Logout%3Fcontinue%3Dhttp://rqtest123.appspot.com/%26service%3Dah'. While in my case this url itself is coming incorrect as I mentioned in my question. – Gopi Jul 21 '10 at 09:09
  • can you provide me url of your app? – Manjoor Jul 21 '10 at 09:39
  • Sorry but I cannot provide url of app because as I mentioned it allows only one user - the admin and no one else will be able to access it. I will try to reproduce it in some other test deployment and check out. – Gopi Jul 22 '10 at 04:54
  • +1 Thanks for your help. The problem was weird as I posted in my answer. – Gopi Oct 05 '10 at 16:54
1

Finally found it !!!

Earlier, through my spring controller I was passing the created logout url as

model.put("logout-url", UserServiceFactory.getUserService().createLogoutURL("/"));

And my JSP code looked like -

<a class="link" href="${logout-url}">Logout</a>

The variable name logout-url was the problem. Replaced it with logoutUrl and everything worked fine ! The - is not allowed in variable name.

Gopi
  • 10,073
  • 4
  • 31
  • 45