problem with 404

Asked by marc

I just upgraded to play-stable-5 and I am getting a 404 for a page which was working. The error page shows a path which is not in my routes file. I deleted the tmp folder but it doesn't work. Where do I clear this?

Question information

Language:
English Edit question
Status:
Solved
For:
play framework Edit question
Assignee:
No assignee Edit question
Solved by:
marc
Solved:
Last query:
Last reply:
Revision history for this message
Guillaume Bort (guillaume-bort) said :
#1

What is the path and what is your route file ?

On 18 avr. 09, at 20:45, marc <email address hidden>
wrote:

> New question #67855 on play framework:
> https://answers.launchpad.net/play/+question/67855
>
> I just upgraded to play-stable-5 and I am getting a 404 for a page
> which was working. The error page shows a path which is not in my
> routes file. I deleted the tmp folder but it doesn't work. Where do
> I clear this?
>
> --
> You received this question notification because you are a member of
> play
> framework developers, which is an answer contact for play framework.

Revision history for this message
marc (marc-ttux) said :
#2

I have this:
GET /ajax/chat/actives/ Chat.actives

In the 404, there is:
GET /ajax/chat/actives Chat.actives (no / at the end)

Before I upgraded to play-stable-5 I had:
GET /ajax/chat/actives/ Chat.actives
GET /ajax/chat/actives Chat.actives
meaning both lines

I removed the second one.

Revision history for this message
marc (marc-ttux) said :
#3

It's removing the / at the end in stable-5 so
GET /ajax/chat/actives/ Chat.actives
becomes
GET /ajax/chat/actives Chat.actives

I have put
GET /ajax/chat/actives// Chat.actives
and now
/ajax/chat/actives/ works...

I guess it's a bug?

Revision history for this message
Guillaume Bort (guillaume-bort) said :
#4

Do you make the request with a / at the end ?

On 18 avr. 09, at 21:00, marc <email address hidden>
wrote:

> Question #67855 on play framework changed:
> https://answers.launchpad.net/play/+question/67855
>
> Status: Answered => Open
>
> marc is still having a problem:
> I have this:
> GET /ajax/chat/actives/ Chat.actives
>
> In the 404, there is:
> GET /ajax/chat/actives Chat.actives (no / at the end)
>
> Before I upgraded to play-stable-5 I had:
> GET /ajax/chat/actives/ Chat.actives
> GET /ajax/chat/actives Chat.actives
> meaning both lines
>
> I removed the second one.
>
> --
> You received this question notification because you are a member of
> play
> framework developers, which is an answer contact for play framework.

Revision history for this message
marc (marc-ttux) said :
#5

In play.mvc.Router.java you do
if (route.path.endsWith("/") && !route.path.equals("/")) {
   route.path = route.path.substring(0, route.path.length() - 1);
}

I think the problem comes from there, is there a specific reason for doing this?

I removed that and now it works

Revision history for this message
Guillaume Bort (guillaume-bort) said :
#6

Yes it's likely a bug.

It's not very clear how Play! handles the / character at the path end.

I will try to clarify that for the next release.

On 18 avr. 09, at 21:22, marc <email address hidden>
wrote:

> Question #67855 on play framework changed:
> https://answers.launchpad.net/play/+question/67855
>
> marc gave more information on the question:
> It's removing the / at the end in stable-5 so
> GET /ajax/chat/actives/ Chat.actives
> becomes
> GET /ajax/chat/actives Chat.actives
>
> I have put
> GET /ajax/chat/actives// Chat.actives
> and now
> /ajax/chat/actives/ works...
>
> I guess it's a bug?
>
> --
> You received this question notification because you are a member of
> play
> framework developers, which is an answer contact for play framework.

Revision history for this message
Guillaume Bort (guillaume-bort) said :
#7

Can you please post a bug report about that to keep a trace ?

ty

On 18 avr. 09, at 21:30, marc <email address hidden>
wrote:

> Question #67855 on play framework changed:
> https://answers.launchpad.net/play/+question/67855
>
> Status: Answered => Open
>
> marc is still having a problem:
> In play.mvc.Router.java you do
> if (route.path.endsWith("/") && !route.path.equals("/")) {
> route.path = route.path.substring(0, route.path.length() - 1);
> }
>
> I think the problem comes from there, is there a specific reason for
> doing this?
>
> I removed that and now it works
>
> --
> You received this question notification because you are a member of
> play
> framework developers, which is an answer contact for play framework.

Revision history for this message
marc (marc-ttux) said :
#8

Ok, I do that.