각 행의 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의 ID에 공백을 넣는 것처럼 보입니다. 문자열에서 제거하십시오. – mittmemo