zoukankan      html  css  js  c++  java
  • JSP项目_Web路径_磁盘物理路径

    1、

    JSP 页面中:

    <br/>
    (1) : <%=request.getContextPath()%>
    <br/>
    (2) : <%=request.getServletContext().getRealPath("/")%>
    <br/>
    (3) : <%=request.getServletContext().getRealPath("")%>

    输出为:

    (1) : /Html5_Video_Simple_01
    (2) : ...workspace__MyEclipse2013.metadata.me_tcat7webappsHtml5_Video_Simple_01
    (3) : ...workspace__MyEclipse2013.metadata.me_tcat7webappsHtml5_Video_Simple_01

    2、

    servlet中:

    System.out.println("servlet(1) : "+this.getServletContext().getContextPath());
    System.out.println("servlet(2) : "+this.getServletContext().getRealPath("/"));
    System.out.println("servlet(3) : "+this.getServletContext().getRealPath(""));

    输出为:

    servlet(1) : /Html5_Video_Simple_01
    servlet(2) : ...workspace__MyEclipse2013.metadata.me_tcat7webappsHtml5_Video_Simple_01
    servlet(3) : ...workspace__MyEclipse2013.metadata.me_tcat7webappsHtml5_Video_Simple_01

  • 相关阅读:
    撤回本地的提交
    antd Table每列样式修改
    大数组拼树
    滑动加载
    数组合并去除重复内容
    获取前一周期日期
    js 对象根据value获取对应的key
    less git上传问题处理
    5G
    Linux怎么安装node.js
  • 原文地址:https://www.cnblogs.com/codeskilla/p/4986758.html
Copyright © 2011-2022 走看看