项目结构如下。
Login.jsp 和 ZhuCe.jsp 在同一个包myjsp中
当前在Login.jsp页面中 
我用window.loaction.href="myjsp/ZhuCe.jsp"  ; 在火狐和Opera中能够正常实现跳转 正常跳转到 http://localhost:8888/WebProject2/myjsp%5CZhuCe.jsp。但是在IE中就不行了 。IE会跳转到http://localhost:8888/WebProject2/myjsp/myjsp/ZhuCe.jsp 错误如果将window.loaction.href="myjsp/ZhuCe.jsp"  ;改成window.loaction.href="ZhuCe.jsp"  ;就能再IE中正常跳转,但是在火狐和Opera中就不行了。用window.open("");和document.loaction.href="" 这两种方法都跟上面的效果一样.这该怎么解决啊? 

解决方案 »

  1.   

    图片都显示不出来     项目结构如下:   WebProject2
                  webRoot
                         myjsp
                             Login.jsp
                             ZhuCe.jsp
                         WEB-INF
      

  2.   

    window.loaction.href = "${pageContext.request.contextPath}/myjsp/ZhuCe.jsp";
      

  3.   

    这不是浏览器跳转的问题,而是你自己没把相对地址、绝对地址,以及 Web 应用的 Context Path 搞清楚。
      

  4.   

    设一个<base>标签应可以可以了。
    <%String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";%>
    <base href="<%=basePath%>" />
      

  5.   

    设一个<base>标签应可以可以了。
    <%String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath()+"/";%>
    <base href="<%=basePath%>" />