【发布时间】:2014-04-16 07:39:10
【问题描述】:
如果没有给出表单 ID,我希望有一个例外。
但这会引发异常Cannot find the declaration of element 'ui:composition'。
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://java.sun.com/jsf/html"
elementFormDefault="qualified">
<complexType name="form">
<attribute name="id" use="required"/>
</complexType>
</schema>
这是我验证的 xhtml:
<ui:composition template="/template/overall.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
xmlns:h="http://java.sun.com/jsf/html">
... <h:form id="Make_sure_i_exists"> ...
</ui:composition>
问候
【问题讨论】:
-
为了验证我使用了 maven 的
xml-maven-plugin。
标签: java html validation jsf-2 xsd