在 JSP/HTML 中不想讓用戶看到但需隨表單提交的字段,有兩種主流方式:
<input type="hidden">(推薦)<input type="hidden" name="token" value="abc123">
request.getParameter("token") 可取。<input type="text" style="display:none">display:flex 可能影響佈局計算。題主場景「不想顯示到瀏覽器頁面」直接用 type="hidden" 即可。