0

I am using Play 1.2.5. I have an action "welcome" which has redirect statement to an action "view1". Redirect seems to be working ( checked my log) but view of the action "view1" is not displaying after redirect.

  public static void welcome(){

     redirect("/view1");
  }
  public static void view1(){
   // code goes here....

  }

After redirect, view of view1 action is not displaying.

Thanks in advance !!

4

3 回答 3

2

代替

redirect("/view");

打电话

view1();
于 2013-01-11T08:49:06.553 回答
0

你的方法view1结束了render();吗?

如果不是,您的控制器将不会显示任何内容。

您还需要与您的view1.html文件处于同一级别的正确welcome.html文件。

于 2013-01-14T12:38:25.470 回答
0

您可能需要检查 conf/routes 文件以确保 view1 在有效的路由匹配器中公开。例如:

* /view1         WhatEverYourControllerClassIsCalled.view1

或通过一些通用匹配器

* /{action}      WhatEverYourControllerClassIsCalled.{action}
于 2013-01-27T16:29:42.990 回答