response.sendRedirect()里面的参数可以是变量吗?

response.sendRedirect("list.jsp");直接加URL地址可以,
response.sendRedirect("list.jsp?type=<%=types%>");不行
有什么办法可以解决,谢谢.

可以是变量,只不过你用法不对。

如果是ASP:
response.sendRedirect("list.jsp?type="&types)
如果是ASP.net:
response.sendRedirect("list.jsp?type="+types);
如果是JSP:
response.sendRedirect("list.jsp?type="+types);
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-03-28
因为你用了两个response.sendRedirect