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.

2 Answers 2

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.

5
  • 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
    Commented Jul 21, 2010 at 6:51
  • Hey thanks for your efforts. I notice the logout url in your page as 'rqtest123.appspot.com/_ah/logout?continue=https://…'. While in my case this url itself is coming incorrect as I mentioned in my question.
    – Gopi
    Commented Jul 21, 2010 at 9:09
  • can you provide me url of your app?
    – Manjoor
    Commented Jul 21, 2010 at 9: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
    Commented Jul 22, 2010 at 4:54
  • +1 Thanks for your help. The problem was weird as I posted in my answer.
    – Gopi
    Commented Oct 5, 2010 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.