【发布时间】:2014-08-30 02:18:53
【问题描述】:
我的应用程序类如下所示:
public class Application extends Controller {
public static Result index() {
return ok(index.render("<p>This is a paragraph</p>"));
}
我的index.scala.html 文件看起来像:
@(htmlcode: String)
@main("Example") {
@htmlcode
}
我的main.scala.html 文件相当简单,带有标准的!DOCTYPE 声明、html、head、body 标签等。
...
<body>@content</body>
...
但是当我运行我的应用程序时,索引页面会显示源代码<p>This is a paragraph</p> 而不仅仅是This is a paragraph。源文件看起来像
...
<body>
<p>This is a paragraph</p>
</body>
...
如何让页面呈现代码而不是仅仅显示它?
【问题讨论】:
标签: java html scala playframework-2.0