我有这样的DTD:http://fast-code.sourceforge.net/template.dtd 但是当我包括在XML我得到警告:该文档没有检测到语法约束(DTD或XML模式).xml是:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE templates PUBLIC "//UNKNOWN/" "http://fast-code.sourceforge.net/template.dtd">
<templates>
<template type="INSTANCE_OF_CLASS">
<description>Used to Create instance of class</description>
<variation>asasa</variation>
<variation-field>asasa</variation-field>
<class-pattern>asasa</class-pattern>
<getter-setter>setter</getter-setter>
<allowed-file-extensions>java</allowed-file-extensions>
<number-required-classes>1</number-required-classes>
<allow-multiple-variation>false</allow-multiple-variation>
<template-body>
<![CDATA[
// Creating new instance of ${class_name}
final ${class_name} ${instance} = new ${class_name}();
#foreach ($field in ${fields})
${instance}.${field.setter}(${field.value});
#end
]]>
</template-body>
</template>
</templates>
Run Code Online (Sandbox Code Playgroud)
编辑:我更改了xml,我现在收到此错误:
元素类型的内容"模板"必须描述?,变异场匹配"(,变化?,允许 - 多变化?,类图案?,消气部件设置器?,允许文件的扩展?,数须─班?,模板型)".
在JSF 2对注释的大力支持之后,我想知道我将使用它faces-config.xml.它现在的重要性是什么?
换句话说,只能faces-config.xml通过注释而不是通过注释完成哪些配置?
现在我用它的所有东西都是声明Spring的EL解析器.
<?xml version="1.0" encoding="UTF-8"?>
<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
version="2.0">
<application>
<el-resolver>
org.springframework.web.jsf.el.SpringBeanFacesELResolver
</el-resolver>
</application>
</faces-config>
Run Code Online (Sandbox Code Playgroud) 我得到了以下错误
<Ignored XML validation warning> org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 55;
SchemaLocation: schemaLocation value = 'http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/tx' must have even number of URI's.
Run Code Online (Sandbox Code Playgroud)
我的调度程序servlet具有以下命名空间
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
Run Code Online (Sandbox Code Playgroud)
我通过以下方式取代了以上所有内容
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
Run Code Online (Sandbox Code Playgroud)
我的错误消失了.
怎么会发生任何一个人说?
xml ×2
dtd ×1
eclipse ×1
faces-config ×1
java ×1
jsf ×1
jsf-2 ×1
spring-mvc ×1
validation ×1
xsd ×1