Playframework 将生成的HTML页面与Play framework应用程序集成
我有一个完整的HTML的web服务生成代码,我想将生成的HTML代码集成到我的Play framework应用程序的视图中。以下是我的控制器中的代码:Playframework 将生成的HTML页面与Play framework应用程序集成,playframework,playframework-1.x,Playframework,Playframework 1.x,我有一个完整的HTML的web服务生成代码,我想将生成的HTML代码集成到我的Play framework应用程序的视图中。以下是我的控制器中的代码: public static void showReport(String specification) { String[] results= ReportRunner2.generateReport(specification); //call web service String output = HTMLUtil.extra
public static void showReport(String specification) {
String[] results= ReportRunner2.generateReport(specification); //call web service
String output = HTMLUtil.extractBody(results[0]); //output is the complete HTML code
render(output);
}
在my showReport.html中:
#{extends 'main.html' /}
${output}
结果是生成的HTML没有正确呈现,因为从模板中添加了冗余的
和
,我尝试删除main.HTML中的那些标记,但不起作用,有人能帮我吗?尝试使用renderHtml(输出)
而不是render(输出)
。没有模板将被使用,只是你的html