[英]importing content into jsf h:inputTextarea
我们目前正在将Spring mvc / jsp应用程序转换为jsf应用程序。
以前,我们可以将JSP段文件的内容导入这样的文本区域
<textarea id="sectionSixPointOne" name="sectionSixPointOne">
<jsp:include page="sect_six_point_one.jspf"/>
</textarea>
神奇的是,jsp的内容出现在了文本区域的内容中。
我们正在尝试对JSF进行同样的操作,但是我准备面对自己开枪。
我们尝试过
<h:inputTextarea id="sectionSixPointOne">
<ui:include src="section_six_sect_one.xhtml"/>
</h:inputTextarea>
但是它包括文本区域之后的内容,而不是其中的内容。
我试图将内容的内容作为h:inputTextarea的value参数包含在内,但是编译器将其语法,引号/尖括号等弄得一团糟。
<h:inputTextarea id="sectionSixPointOne" value=<ui:include src="section_six_sect_one.xhtml"/>
</h:inputTextarea>
我宁愿直接将内容包括在jsf页面中,也不愿将其加载到支持bean中。 任何人都有任何想法可以用jsf来完成(对于任何愚蠢的人,我都是JSF newb表示歉意?
只需将<h:inputTextarea id="sectionSixPointOne">
放入要包含在文件中的值即可。
这样,您无需将其插入某个组件中,只需将整个内容提取到其自己的文件中即可。
因此,您的代码如下所示:
<ui:include src="section_six_sect_one.xhtml"/>
并在section_six_sect_one.xhtml中:
<ui:composition xmlns=... >
<h:inputTextarea id="sectionSixPointOne" value="yourIncludedText"/>
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.