Edited by:
I am running Ubuntu 10.04 and this problem occurs in Chrome (7.0.517.44), however everything works fine in Firefox.
It is very strange. I have another application in which redirectToOriginalUrl works fine in the "dev" mode in both browsers, but does not work in the "prod" mode (again in both browsers). Wow, I have no idea what is going on!
Problem:
I get the strangest error in Playframework (version 1.1.1), where redirectToOriginalURL does not work in the Secure module.
I have 2 Application.java controllers and NameC.java
The Application / index.html view displays a simple page with an action link in NameC.java (NameC.index ())
NameC.java is protected by @With annotation (Secure.class)
Here is the stream I expect. First, the user goes to the application home page. There they click on the link that will lead them to NameC.index. However, since NameC is protected by the Secure module, the user must be delivered to the login form (since they have not logged in yet), and after successful login, they should see the page presented by NameC.index
I get a registration form, but after a successful login, the user goes to Application.index. I tried putting the print expression in the Secure.redirectToOriginalURL () method, and it looks like the “url” does not exist in the flash area.
Here is my code:
Application.java
public class Application extends Controller { public static void index() { render(); } }
Application /index.html
<a href="@{NameC.index()}">Click here</a>
NameC.java
@With(Secure.class) public class NameC extends Controller { public static void index() { render(); } }
HINT /index.html
You should see this after a successful login. <a href="@{Secure.logout()}">logout</a>
I am sure that I am missing something very simple ... can someone please help me figure out what I am missing.