JSP

1.下面这行代码有什么用啊。
<%
//必须set html status 200
response.setStatus(200);
%>
2.window.top.location.href=""和window.location.href=""有什么区别。。。。

如果你的index.jsp页面用了

,里面包含有main.jsp那么你在main.jsp页面调用window.location.href就是将main.jsp重定向,如果调用了 window.top.location.href那么就是将index.jsp重定向,就是整个页面重定向,你可以查一下,top,parent,在页面中的用法。。。

返回 HTTP Response 的 Status 为 200

说明服务器正确的处理了 这次请求.

1 [quote]response.setStatus(200); [/quote]

设置返回的响应码为200

2 window.top.location.href=
对当前页面重定向,即使在框架中,也对整个页面 进行替换

window.location.href
对当前页面重定向,如果在框架中,只对当前页面所在框架进行替换

response.setStatus(200);
这是设置响应的状态码为200

是指
200 - 服务器成功返回网页