簡體   English   中英

元素類型“ Resource”之后必須是屬性說明“>”或“ />”

[英]Element type “Resource” must be followed by either attribute specifications, “>” or “/>”

這是我的代碼。 我不明白為什么會有錯誤。元素類型“ Resource”必須后面跟屬性說明“>”或“ />”。

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/Ex">

<Resource name="WebTestDS" type="javax.sql.DataSource" auth="Container" 
           driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
           url="jdbc:sqlserver://localhost:1433;databaseName=Student"
           username="sa" password="123456" />

</Context>

我復制粘貼了您的XML,但它破壞了我的XML格式化工具。 似乎您有一個特殊的字符,它在:之后不是規則的空格

<Resource name...
         ^ invalid character here

編輯 :這似乎是一個表意空間 我使用此Java代碼來找出:

String s = "<Resource ";
s.chars().forEach(System.out::println);

輸出:

...
99    // c
101   // e
12288 // ideographic space (must be 32 for a regular space)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM