有没有办法在HTML表中传递servlet变量? 我想在代码中留下的html表空间中传递这些servlet变量。
servlet代码:
int a=parseInt(request.getParameter("pno"));
String b=request.getParameter("zone");
String c=request.getParameter("ano");
String d=request.getParameter("bill");
String e=request.getParameter("rd1");
String f=request.getParameter("userpass");
out.println("<table margin-top:'200px'>");
out.println(" <tr><td>P_No:</td><td width='75%' colspan='3'> </td</tr>");
out.println("<tr><td>Zone:</td><td width='75%' colspan='3'> </td></tr>");
out.println("<tr><td>Aadhaar.No:</td><td width='75%' colspan='3'> </td></tr>");
out.println("<tr><td>Bill_No:</td><td width='75%' colspan='3'> </td></tr>");
out.println("<tr><td>Patient-Status:</td><td width='75%' colspan='3'> </td></tr>");
out.println("<tr><td>Password:</td><td width='75%' colspan='3'> </td></tr>");
答案 0 :(得分:0)
只需将其连接到out.println
即可int a=parseInt(request.getParameter("pno"));
String b=request.getParameter("zone");
String c=request.getParameter("ano");
String d=request.getParameter("bill");
String e=request.getParameter("rd1");
String f=request.getParameter("userpass");
out.println("<table margin-top:'200px'>");
out.println(" <tr><td>P_No:</td><td width='75%' colspan='3'>" + a + "</td</tr>");
类似于其他表值。