- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我已经使用以下 TLD 编写了我的 JSP 自定义标记:
<?xml version="1.0" encoding="UTF-8"?>
<taglib
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-jsptaglibrary_2_1.xsd"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.1">
<tlibversion>1.0</tlibversion>
<jspversion>2.1</jspversion>
...
现在 Eclipse Helios 提示“没有检测到文档的语法约束(DTD 或 XML 模式)。”
我知道如何禁用警告,而是想知道如何通过提供 DTD 或架构信息来解决问题。
顺便说一句,在上面的 XML 中我有:
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-jsptaglibrary_2_1.xsd"
但这似乎没有帮助。
更新 根据 Peter 的建议,我检查了我的 Window > Preferences > XML > XML Catalog,我发现以下内容可能适合:
Entry element: Public
Location: dtdsAndSchemas/web-jsptaglibrary_1_2.dtd in jar file
usr/local/eclipse/plugins/org.eclipse.jst.standard.schemas_1.1.0.v201003031644.jar
URI: jar:file:/usr/local/eclipse/plugins/org
.eclipse.jst.standard.schemas_1.1.0.v201003031644.jar!/dtdsAndSchemas
/web-jsptaglibrary_1_2.dtd
Key type: Public ID
Key: -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN
所以我尝试将以下内容添加到我的顶级域名中:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_2.dtd">
现在我有以下错误:
在此行发现多个注释:
值为“http://java.sun.com/xml/ns/javaee”的属性“xmlns”的值必须为“http://java.sun.com/JSP/TagLibraryDescriptor”。
schema_reference.4:无法读取架构文档“web-jsptaglibrary_2_1.xsd”,因为
1) 找不到文档;2)文档无法读取;3)文档的根元素不是。
元素类型“taglib”的内容必须匹配“(tlib-version,jsp-version,short-name,uri?,display-name?,small-icon?,large-icon?,description? ,validator?,listener*,tag+)”。
最佳答案
一个多月以来我都没有费心去研究这个问题,因为无论如何一切都在 Tomcat 中运行。最近我尝试了 GlassFish 和 JBoss。虽然 GlassFish 3.1.1 没有提示,但 JBoss 7.0 拒绝运行该应用程序,因为 tld 问题。与此同时,我还将 Eclipse Helios 更新为 Indigo。
我发现我同时使用了 DTD 和 Schema,这不太好。我放弃了 DTD,只保留了 Schema。我不得不重命名一些标签,例如 tlibversion 到 tlib-version,shortname 到 short-name,bodycontent 到 body-content,tagclass 到 tag-class,删除信息标签,我用 XML 注释替换它。我想这可能是规范的更新版本,因为在我遵循的示例中,它们的命名没有连字符。
之后一切正常:Eclipse 不再发出任何警告,JBoss 完美运行应用程序。这里的引用是工作的顶级域名:
<?xml version="1.0" encoding="UTF-8"?>
<taglib
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="2.1">
<tlib-version>1.0</tlib-version>
<short-name>StivloTags</short-name>
<uri>http://www.stefanolocati.it/</uri>
<!-- Example from http://www.stardeveloper.com/articles/display.html?article=2001081301&page=1 -->
<tag>
<name>firstTag</name>
<tag-class>obliquid.tag.FirstTag</tag-class>
<body-content>empty</body-content>
<attribute>
<name>name</name>
<required>false</required>
</attribute>
</tag>
<!-- Truncate text after maxLength or 80 chars, adding "&hellip;" if the the text was longer -->
<tag>
<name>ellipsis</name>
<tag-class>obliquid.tag.Ellipsis</tag-class>
<body-content>scriptless</body-content>
<attribute>
<name>maxLength</name>
<required>false</required>
</attribute>
</tag>
</taglib>
关于java - JSP 自定义标签 : missing DTD/XML Schema,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6134139/
Schema.org中的 priceRange 属性是什么意思? https://schema.org/priceRange 我不明白这是什么意思,我住在哈萨克斯坦,也许我的文化或语言不明确。您能举一
用作引用:https://support.google.com/webmasters/answer/146750?hl=en 您会注意到在“产品”下有一个属性类别,此外页面下方还有一个示例: Too
我对 Doctrine 很陌生。我用 Doctrine 为我自己做了两个小项目,但现在我要为我的客户创建大项目。该项目将有50多个表。有没有办法生成schema.yml?我尝试了 DB Designe
在 Mongoose 模式中,我们可以通过两种方式创建方法 SchemaName.methods.functionName 和 SchemaName.statics.functionName . 静态
我读了这个Google doc .它说我们不使用列表中的产品。 那么对于产品列表(具有多页的类似产品的类别,如“鞋子”),推荐使用哪种模式? 我用这个: { "@context": "htt
我目前在做DBpedia数据集,想通过wikidata实现schema.org和DBpedia的映射。因此我想知道 schema.org 和 wikidata 之间是否存在任何映射。 最佳答案 我认为
如果看一下 Movie在 schema.org 中输入,actor 和 actors 属性都是允许的(actor 取代 actors)。但是 author 和 contributor 属性没有等效项。
我正在尝试将 Vertica 架构从一个物理集群导出和导入到另一个物理集群。我的测试实例有一个集群,我的生产实例有 3 个集群。 我探索了以下选项,但它们仅限于在一个物理 Vertica 实例上移动数
我们有一些餐厅有多个地点或分支机构。我想包含正确的 Schema.org 标记,但找不到任何允许列出多个餐厅的内容。 每家餐厅都有自己的地址、电子邮件、电话和营业时间,甚至可能是“分店名称”。 两个分
我在一个页面中有多个综合评分片段。 有没有办法让其中之一成为默认值?将显示在搜索引擎结果中的那个? 谢谢大家! 更新:该网页本质上是品牌的页面。它包含品牌评论的总评分及其产品列表(每个产品的总评分)。
有谁知道是否可以用另一个 XML 模式验证一个 XML 模式?如果是这样,那里有引用实现吗?我想使用 JAXB 解析模式文档。 最佳答案 当然。大多数时候,您只需将浏览器指向用作 XML 文档 nam
我正在尝试创建 springdoc swagger 文档,我想代表一个具有数据类型 Map 的请求正文以更好的方式为客户提供可读性。但是当我声明 @io.swagger.v3.oas.annotati
当我们创建数据库时会创建一个公共(public)模式,如果我们不指定任何模式,则会在公共(public)模式下创建表。如果您在从数据库中删除公共(public)模式时看到或遇到任何问题,能否告诉我,因
网站的根页面(即 http://example.com/ )的特殊之处在于它是默认的着陆页。它可能包含许多不同的对象类型。 它可能被认为是一个网站,或者一个博客等... 但它是否也应该被标记为给定对象
我网站的产品页面有面包屑导航。 Product 类型没有breadcrumb。 我这样做: "@type": "Webpage", "breadcrumb": {... "mainEntity":
关闭。这个问题是opinion-based 。目前不接受答案。 想要改进这个问题吗?更新问题,以便 editing this post 可以用事实和引文来回答它。 . 已关闭 1 年前。 社区1年前审
我正在尝试从模式注册表中检索给定 kafka 主题的模式主题版本。我可以使用 client.register(schema-name, schema) 成功发布新版本,但我不确定如何检索版本。我在下面
我有一个地方/本地企业,它有各种字段,可以很好地映射到 schema.org 条目。有一个字段我不知道如何标记。我们有指向该企业社交媒体帐户的链接,例如他们的 Twitter 帐户、Facebook
我在 schema.schema 中有一个 number_of_servers 字段,我需要为其设置一个范围。有什么办法吗? Schema: map[string]*schema.Schema{
在向我的站点添加微数据时,我使用了 schema.org 上的词汇表。 目前,我使用 http://schema.org/SoftwareApplication 来标记软件。由于 schema.org
我是一名优秀的程序员,十分优秀!