Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/357.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在ftl(freemarker)上显示xhtml_Java_File_Xhtml_Freemarker - Fatal编程技术网

Java 如何在ftl(freemarker)上显示xhtml

Java 如何在ftl(freemarker)上显示xhtml,java,file,xhtml,freemarker,Java,File,Xhtml,Freemarker,首先,对不起我的英语不好。我的问题是: 有一个现成的*.xhtml文件和几个图像。() 我不想展示它,并且这样做: <!DOCTYPE html> <html> <head> <title>Title</title> </head> <#if uuid?? > <#include "/report/${uuid!}.xhtml"/> </#if> ... 标题 ...

首先,对不起我的英语不好。我的问题是: 有一个现成的*.xhtml文件和几个图像。(
) 我不想展示它,并且这样做:

<!DOCTYPE html>
<html>
<head>
    <title>Title</title>
</head>
<#if uuid?? >
    <#include "/report/${uuid!}.xhtml"/>
</#if>
...

标题
...
,但图像当然不会显示。 我怎样才能让它工作?
提前谢谢

FreeMarker不关心您包含的内容,包括XHTML或SQL或其他内容。你检查输出了吗?它是否包含您想要的HTML?您确定已设置
uuid
?(而且你不需要
${uuid!}
中,因为你已经检查了它的存在。)(顺便说一句,我希望那些
${uuid}.xhtml
-s的内容不仅仅是一个
img
,带有可以从uuid推导出来的
src
。)谢谢重播!是,设置uuid,并显示所需文件,即包括正常工作。只是它有如下上下文:ip:port/applicationContext/reportReview.ftl。但是图像在本地文件系统中,因此在reportReview.ftl中显示除图像以外的所有内容。不,*.xhtml的内容不仅仅是img。图像-这只是报告的摘要部分,因此图像URL-s是错误的。听起来和FreeMarker没有任何关系。