是不是使用response.sendRedirect() 地址重定向后会重新开启request等资源,所以尽量使用request.getDispacther()   那使用window.location.href的话,会不会也重新开启了request等资源呢?

解决方案 »

  1.   

    那这样说的话
    window.location.href 与 response.sendRedirect()作用一致?
      

  2.   

    window.location.href是客户端语言,response.sendRedirect()是服务器端的,效果你可以看得到,至于你想要的原理,你可以看看源文件,到底response.sendRedirect()会编译成什么html代码。自己对比一下,应该就清楚了
      

  3.   

    就是
    response前不能输出HTML
    window.location前可以输出HTML