大家用什么语句进行页面的跳转?

javawriter 2003-03-19 02:56:22
大家用什么语句进行页面的跳转?各有何优缺点?常用在什么时候?
...全文
56 20 打赏 收藏 转发到动态 举报
写回复
用AI写文章
20 条回复
切换为时间正序
请发表友善的回复…
发表回复
catzm 2003-03-21
  • 打赏
  • 举报
回复
response.setContentType("text/html; charset=GBK");
//可以传递需要的数据
request.getAttribute("var",var);
RequestDispatcher dispatcher;
dispatcher = getServletContext().getRequestDispatcher("/jsp/test.jsp");
dispatcher.include(request,response);
JavaCoffee 2003-03-21
  • 打赏
  • 举报
回复
给你另一种方法:
<jsp:forward page="index.jsp" />
icecloud 2003-03-21
  • 打赏
  • 举报
回复
<meta http-equiv="refresh" content="5;url=http://xxxx.com">
黑马 2003-03-21
  • 打赏
  • 举报
回复
<a href="a.jsp" target="_self">
<jsp:forward page="A.jsp"/>
response.Redirect(url)
<form name="Form1" method="post" ACTION="B.jsp">

还javascript的方法,例如location
javawriter 2003-03-21
  • 打赏
  • 举报
回复
?
scriptskychen 2003-03-21
  • 打赏
  • 举报
回复
<meta http-equiv="refresh" content="5;url=http://xxxx.com">
可以修改你的时间!
response.sendRedirect(URL);
在jsp中
Genexsun 2003-03-21
  • 打赏
  • 举报
回复
给你另一种方法:
<form method="POST" name="main_menu" action="mainmenu.jsp">

<input type="submit" value="確定"></td>

</form>
Genexsun 2003-03-21
  • 打赏
  • 举报
回复
response.sendRedirect(URL);
javawriter 2003-03-21
  • 打赏
  • 举报
回复
那么 <jsp:forward page="index.jsp" />和response.sendRedirect("index.jsp")有什么不同呢?
aredline 2003-03-21
  • 打赏
  • 举报
回复
在servlet中如何进行跳转?
javawriter 2003-03-19
  • 打赏
  • 举报
回复
怎样过5秒跳转?
d80 2003-03-19
  • 打赏
  • 举报
回复
location.href='aa.jsp'
这个在form中
this.form.action='aa.jsp'

alarda 2003-03-19
  • 打赏
  • 举报
回复
不知道你说的页面跳转是什么意思,但上面所说的方法都是相当于一个超链接。

如果在form 里面我们用 action="../x.jsp",form相对简单,好用。
response.Redirect(url)主要用于返回一个页面,可做身份验证等等。
看你怎么用咯。
javawriter 2003-03-19
  • 打赏
  • 举报
回复
那么定时跳转呢?
johnszhang 2003-03-19
  • 打赏
  • 举报
回复
写javascript方法,在方法里用document.form[0].action="";
document.form[0].submit();
应该可以吧!
javawriter 2003-03-19
  • 打赏
  • 举报
回复
是response.Redirect()吗?
上面几种都有人用吗?
ganyechuan 2003-03-19
  • 打赏
  • 举报
回复
看情况而定,还有看你喜欢了,
gianfeng 2003-03-19
  • 打赏
  • 举报
回复
jsp里面的:好象有个什么send redirect的。
javascript里面的:window.location
xmpp 2003-03-19
  • 打赏
  • 举报
回复
action
supermarket2000 2003-03-19
  • 打赏
  • 举报
回复
submit()
<a href=> </a>

81,091

社区成员

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

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