【发布时间】:2014-07-24 15:19:26
【问题描述】:
我有一个模板,其中定义了<h:form>。这个<h:form> 在整个应用程序中用于实体的 CRUD 页面。
所以,在某个地方我需要另一个enctype 用于表单,以便我可以上传文件。我想我可以用模板中的一个方面来解决这个问题:
<h:form id="main-form">
<f:facet name="enctype">
<ui:insert name="form-enctype"/>
</f:facet>
<ui:insert name="buttons"/><p/>
<ui:insert name="content"/><p/>
<ui:insert name="buttons"/>
<ui:insert name="additionalHelper"/>
</h:form>
在具体页面上,我想以这种方式设置自定义 enctype:
<ui:define name="form-enctype">
<h:outputText value="multipart/form-data"/>
</ui:define>
但在源代码中,我总是以默认的application/x-www-form-urlencodedas enctype 为<h:form> 结束
为什么会这样?在源代码的其他位置,这是正常的。
【问题讨论】:
-
只有指定为具有构面的元素才有构面。你不能随便编造。