菜鸟问答

chengzhe 2003-08-05 09:23:19
response.sendRedirect
怎么用
求各位老大了?
...全文
62 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
bruni 2003-08-05
  • 打赏
  • 举报
回复
response.sendRedirect(destUrl);

destUrl can be something like "/error.jsp". means absolute address.
or "error.jsp" means relative address.
Jeff 2003-08-05
  • 打赏
  • 举报
回复
如果你想转向的话就用这个,比如用户名为tom的话就跳到male.htm页,为marry的话就跳到
female.htm页:
if (username.equals("tom")) {
response.sendRedirect("male.htm");
} else if (username.equals("marry")) {
response.sendRedirect("female.htm");
}

81,094

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧