JSP中若已经接受了上一个页面传的值当再次刷新这个界面时如何保留下来这个值
/admin_two_look_sorc.jsp中有:Stringname=newString(request.getParameter("sorctname").get...
/admin_two_look_sorc.jsp中有:
String name=new String(request.getParameter("sorctname").getBytes("ISO-8859-1"),"GB2312");接受了值,
-----------------------------------------------------------
<form action="./admin_two_look_sorc.jsp" method="post">
请选择所要查看的班级-
<select name="choseclass">
<%
Connection conn4=DriverManager.getConnection(connectDB,Dbuser,Dbpassword);
System.out.println("连接数据库成功");
String sql4 = "SELECT DISTINCT 班级 FROM "+name;
stmt = conn4.prepareStatement(sql4);
rs4=stmt.executeQuery();
while(rs4.next())
{
out.println("<option value="+rs4.getString(1)+">"+rs4.getString(1)+"</option>");
}
%>
<INPUT TYPE="submit" value="确定">
</select>
</form>
</div>
------------------通过<form action="./admin_two_look_sorc.jsp" method="post">在本页中传一个新的值可是他会包一个String name=newString(request.getParameter("sorctname").getBytes("ISO-8859-1"),"GB2312");接受不到他上一级页面给他发的值,这怎么办 展开
String name=new String(request.getParameter("sorctname").getBytes("ISO-8859-1"),"GB2312");接受了值,
-----------------------------------------------------------
<form action="./admin_two_look_sorc.jsp" method="post">
请选择所要查看的班级-
<select name="choseclass">
<%
Connection conn4=DriverManager.getConnection(connectDB,Dbuser,Dbpassword);
System.out.println("连接数据库成功");
String sql4 = "SELECT DISTINCT 班级 FROM "+name;
stmt = conn4.prepareStatement(sql4);
rs4=stmt.executeQuery();
while(rs4.next())
{
out.println("<option value="+rs4.getString(1)+">"+rs4.getString(1)+"</option>");
}
%>
<INPUT TYPE="submit" value="确定">
</select>
</form>
</div>
------------------通过<form action="./admin_two_look_sorc.jsp" method="post">在本页中传一个新的值可是他会包一个String name=newString(request.getParameter("sorctname").getBytes("ISO-8859-1"),"GB2312");接受不到他上一级页面给他发的值,这怎么办 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询