我從數據庫中提取了一些數據,包括每行的id,現在我創建了一些元素,這些元素的ID必須包含從數據庫中提取的ID。無法使用Java代碼指定元素的ID
<%
//Database Codes...I got the rset...
while (rset.next()) {
%>
<div id="<%=rset.getString(1)%>" class="messageContainer">
</div>
<%
}
%>
我收到以下錯誤
Bad value " " for attribute "id" on element "div":An ID must not contain whitespace.
Syntax of id:
An ID consists of at least one character but must not contain whitespace
看起來像你把div中的空格放在...從字符串中去掉它。 – mittmemo 2012-08-20 05:32:58