jsp中response.sendRedirect的问题

来源:百度知道 编辑:UC知道 时间:2024/06/14 02:49:38
在.jsp文件中,以下代码是否正确?如不正确,usernameT=什么 才能将user赋给usernameT?谢谢!
<%String userPost="user";
response.sendRedirect("WenZhenList.jsp?usernameT=userPost");
%>

response.sendRedirect("WenZhenList.jsp?usernameT="+userPost);

来晚了。。1楼的是正确的。
但是sendRedirect里面的参数好像是绝对路径,用相对路径好像是不行的。。忘了。。。太久没用了

<%String userPost = "user";
response.sendRedirect("cc.jsp?usernameT="+userPost);%>
这样写,能明白不?这个时候,你就要把userPost当成一个变量来用了

菜鸟问题,来晚了