zoukankan      html  css  js  c++  java
  • ${pagecontext.request.contextpath}绝对路径理解

    ${pageContext.request.contextPath}是JSP取得绝对路径的方法,等价于<%=request.getContextPath()%> 。也就是取出部署的应用程序名或者是当前的项目名称
    
    比如我的项目名称是demo1在浏览器中输入为http://localhost:8080/demo1/a.jsp ${pageContext.request.contextPath}或<%=request.getContextPath()%>

    取出来的就是/demo1, 而"/"代表的含义就是http://localhost:8080 故有时候项目中这样写${pageContext.request.contextPath}/a.jsp 以访问的jsp为:http://localhost:8080/dmsd-itoo-exam-log-web/course/index.jsp,

    工程名为/dmsd-itoo-exam-log-web为例:request.getContextPath(),得到工程名:/dmsd-itoo-exam-log-web; 注意是 / 加上 工程名: 右斜杠+工程名 不是单单工程名,本质是绝对路径 ,/之前加上 localhost:8080  就可以直接在访问页面
  • 相关阅读:
    句子
    Https
    SSH
    uCMDB
    snapshot与release
    Ansible
    .NET core webApi 使用JWT验证签名(转)
    .NET core 使用Swagger(转)
    微服务的4个设计原则和19个解决方案(转)
    .NET Core 使用RabbitMQ(转)
  • 原文地址:https://www.cnblogs.com/JonaLin/p/11064562.html
Copyright © 2011-2022 走看看