在WebRoot里有个admin文件夹 里面有user_UpdateInput.jsp 修改成功后跳到了update.jsp页面 
在update.jsp页面有几个链接  <a href="index.jsp"/>返回</a>
 <a href="Copy.jsp"/>返回1</a>
 <a href="error.jsp"/>返回2</a>
 <a href="login.jsp"/>返回3</a>
 <a href="welcome.jsp"/>返回4</a>
上面要跳转的这5个页面在admin外面 也就是和admin是同级的问题是 我点击上面这些链接就提示The requested resource (/strDemo/admin/Copy.jsp) is not available.
例如点击 返回1 Copy.jsp 地址栏就变成了这样http://localhost:8090/strDemo/admin/Copy.jsp 但是Copy页面不在admin下
这些页面都不在admin下 地址栏为什么会变成.../admin/Copy.jsp
分不多。。求助~

解决方案 »

  1.   

    用绝对定位解决上面所有问题
    String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
      

  2.   

    package的namespace设置的是admin吧
      

  3.   

    直接写页面名称,默认是在当前文件夹找。
    解决方法:
    1.通过相对路径去定位
    2.用绝对路径定位basePath + 项目总的路径
    3."/" + 项目中的路径
      

  4.   

    加上这个<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    试试
      

  5.   

    使用相对路径
    就会在namespace的位置上寻找