jsp设置网页根目录

来源:互联网 发布:日落黄沙知乎 编辑:程序博客网 时间:2024/06/05 03:55


  <%       String path = request.getContextPath();       String basePath = request.getScheme()+"://" +request.getServerName()+":" +request.getServerPort()+path+"/" ;       //System.out.println("path="+path);    //System.out.println("basePath="+basePath);    %>       <base href="<%=basePath%>" > 

这样设置之后,路径就可以从根目录开始了:

<form id="submit_form" method="post" action="/search/upload_iframe"  </form>   


0 0