Try to use renderHtml(output)
instead of render(output)
. No template will be used, just your html.
Integrate generated HTML page with Play framework application
-
21-09-2022 - |
Вопрос
I've a web service generate code of a complete HTML, I want to integrate the generated HTML code into the view in my Play framework application. here is code in my controller:
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);
}
In my showReport.html:
#{extends 'main.html' /}
${output}
It turns out the generated HTML is not correctly rendered because the redundant <html>
and <body>
added from template, I've tried remove those tags in main.html but it does not work, can anyone help me?
Решение
Не связан с StackOverflow