branaway / Japid

A Java-based statically-typed fast template engine that can be used in any Java code. It has special adapter for use with the Play! Framework.
113 stars 18 forks source link

循环中回调action的编译问题 #40

Open marcogu opened 12 years ago

marcogu commented 12 years ago

在项目中遇到一个问题:如果在模板中有一个循环,循环体中只做一件事:回调action。此时编译的结果不是所期望的,我将例子简化如下:

在controller中有两个action: public class JapidTestController extends JapidController { public static void view1() { renderJapid(); } public static void willBeTempalteInvoke() { renderJapid(); } }

view1 模板的代码如下:

can not be invoke? `for(int i=0; i<10; i++){ `a JapidTestController.willBeTempalteInvoke() `}

此时view1模板的编译结果为: @Override protected void doLayout() { //------ p("\n" + "\n" + "\n" + "can not be invoke?\n");// line 1 for (int i = 0; i < 10; i++) {// line 5 ------期望这里出现回调,可是没有-------------------------- }// line 7 p("\n" + "\n");// line 7

}