这个问题在 2016 年初被问过,但问的人没有得到答案。那么有谁知道如何获取这个已经是 AI 的 ID,但我需要它以 html 形式自动显示。 因此,我要插入一个尚未分配 ID 的新用户。
<h3>Kreirati korisnika</h3>
<form action="kreiraj_korisnika.jsp">
<div class="form-group" >
<label for="id_clan" >ID:</label>
<input type="text" class="form-control" id="id_clan" name="id_clan">
</div>
最佳答案
首先您必须获得下一个可能的 ID。 检查此说明:
https://dev.mysql.com/doc/refman/8.0/en/getting-unique-id.html
然后您可以使用数据:
文本框:
<input type="text" class="form-control" id="id_clan" name="id_clan" value="<%= yourId%>"/>
JSP代码:
<%! String yourId; %>
<%
//do some code to receive your data
yourId="YOUR_ID";
%>
请参阅此处了解更多信息: Assign value to HTML textbox from JSP
或
关于html - 使用 JSP 将数据库中的自动增量 ID 显示到 html 文本字段中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50209289/