jsp中接收id(使用脚本)
list界面跳转到add界面,add界面接收xid的值
<%
String xid = request.getParameter("xid");
%>
<script type="text/javascript">
let xid = <%=xid%>;
alert(xid)
</script>
在form表单下写隐藏域,带着xid跳转后端
<form action="http://localhost:8080/lx?flag=toAdd" method="post">
<input type="hidden" name="xid" value="<%=xid%>">