jsp用if判断跳转到几个页面
<%StringNum=request.getParameter("num");out.print(Num);if("1".equals(request.getParam...
<%
String Num = request.getParameter("num");
out.print(Num);
if("1".equals(request.getParameter("num")) )
{
out.print("<script>window.location='map1.htm';</script>");
}
else if("2".equals(request.getParameter("num")))
{
out.print("<script>window.location='map2.htm';</script>");
}
else if("3".equals(request.getParameter("num")))
{
out.print("<script>window.location='map3.htm';</script>");
}
%>没有执行跳转,只是输出了Num的值
问题是没执行if语句,不知如何解决 展开
String Num = request.getParameter("num");
out.print(Num);
if("1".equals(request.getParameter("num")) )
{
out.print("<script>window.location='map1.htm';</script>");
}
else if("2".equals(request.getParameter("num")))
{
out.print("<script>window.location='map2.htm';</script>");
}
else if("3".equals(request.getParameter("num")))
{
out.print("<script>window.location='map3.htm';</script>");
}
%>没有执行跳转,只是输出了Num的值
问题是没执行if语句,不知如何解决 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询