play2框架我的模板没有看到。 :package views.html不存在 [英] play2 framework my template is not seen. : package views.html does not exist
问题描述
问题是控制器没有看到我想要使用的模板:
The problem is that controller doesn't see template I want to use:
[etl_admin] $ compile [info]编译3 Scala源代码和4个$ $
来源为
D:\ ECLIPSE_WORKSPACES \ play2_apps \ etcl_admin \ targetget \\\cacala-2.9.1 \classes ...
[error]
d:\ECLIPSE_WORKSPACES\play2_apps\etl_admin\app\controllers\EtlWorkflowSeqNodeController.java:7:
错误:包views.html.etlworkflowseqnode不存在[错误]
import views.html.etlworkflowseqnode.list; [错误]结果,
^ [错误]
d:\ECLIPSE_WORKSPACES\play2_apps\etl_admin\app\controllers\EtlWorkflowSeqNodeController.java:14:
错误:不能查找符号
[etl_admin] $ compile [info] Compiling 3 Scala sources and 4 Java sources to D:\ECLIPSE_WORKSPACES\play2_apps\etl_admin\target\scala-2.9.1\classes... [error] D:\ECLIPSE_WORKSPACES\play2_apps\etl_admin\app\controllers\EtlWorkflowSeqNodeController.java:7: error: package views.html.etlworkflowseqnode does not exist [error] import views.html.etlworkflowseqnode.list; [error]
^ [error] D:\ECLIPSE_WORKSPACES\play2_apps\etl_admin\app\controllers\EtlWorkflowSeqNodeController.java:14: error: cannot find symbol
[错误] list.render(EtlWorkflowSeqNode.findTree(jobId))
[错误] ^ [错误]符号:变量列表[错误] < BR>
的位置:类EtlWorkflowSeqNodeController [错误] 2个误差[误差]
{文件:/ d:/ ECLIPSE_WORKSPACES / play2_apps / etl_admin /} etl_admin /编译:编译:
的javac返回非零的退出代码[错误]总时间:7秒,完成
05.06.2012 17:14:44
[error] list.render(EtlWorkflowSeqNode.findTree(jobId))
[error] ^ [error] symbol: variable list [error]
location: class EtlWorkflowSeqNodeController [error] 2 errors [error]
{file:/D:/ECLIPSE_WORKSPACES/play2_apps/etl_admin/}etl_admin/compile:compile:
javac returned nonzero exit code [error] Total time: 7 s, completed
05.06.2012 17:14:44
这是控制器代码:
package controllers;
import play.mvc.Controller;
import play.mvc.Result;
import models.EtlWorkflowSeqNode;
import play.db.jpa.Transactional;
import views.html.etlworkflowseqnode.list; /*LINE #7, Eclipse really tells that there is no such package*/
public class EtlWorkflowSeqNodeController extends Controller {
@Transactional
public static Result list(Integer jobId) {
return ok(
list.render(EtlWorkflowSeqNode.findTree(jobId))
);
}
}
我用项目树附加了一张图片。有这样的包,有名为list的模板。
我该怎么办错误
I've attached an image with my project tree. There is such package and there is template named "list". what do I do Wrong
推荐答案
Omg,这个问题太容易了!
* classes_managed *(此文件夹保存已编译的scala模板)未使用新添加的模板进行更新。昨天我确实试着打电话给播放编译,但没有帮助。新软件包中的新模板未编译。
今天早上我打电话给玩清洁编译 aaand ...万岁!我确实得到了编译模板和丢失包的问题消失了(不要忘记刷新Eclipse项目,强制它从文件系统更新exisitng项目结构。它喜欢缓存所有东西。)
Omg, the problem was so easy! *classes_managed* (this folder keeps compiled scala templates) were not updated with newly added templates. I did try to call play compile yesterday, it doesn't help. New templates from new package were not compiled. This morning I've called play clean compile aaand... hooray! I did get compiled templates and problem with missing package gone away (don't forget to refresh Eclipse project, force it to update exisitng project structure from file system. It likes to cache everything.)
很抱歉令人不安,看起来我在阅读文档时并不专心:(
Sorry for disturbing, seems like I wasn't attentive while reading documentation :(
这篇关于play2框架我的模板没有看到。 :package views.html不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!