zoukankan      html  css  js  c++  java
  • 关于${ctx}拿不到值的问题

    当项目开发时我们喜欢用
    <c:set var="ctx" value="${pageContext.request.contextPath}"/>来获取项目根目录,但是当项目如果为ROOT下时,是获取的空值。这是有另一个方法可以实现。
    <base href="http://...">来设置根目录访问地址。

    关于base标签的知识补充

    基连接 :设置基础路径的

    如果你的<head></head>部分定义了:<base href="http://www.google.com/">,那么以后你就不用每次都把路径全部写上了

    例如:


    以前:<a href="http://www.google.com/xxx.html"></a>,

    现在:<a href="xxx.html"></a> //<head></head>部分加了:<base href="http://www.google.com/">后


    以前:<img src="http://www.google.com/xxx.jpg">

    现在:<img src="xxx.jpg"> //<head></head>部分加了:<base href="http://www.google.com/">后


    以前:<form action="http://www.google.com/xxx.html">

    现在:<form action="xxx.html"> //<head></head>部分加了:<base href="http://www.google.com/">后


    以前:<iframe src="http://www.google.com/xxx.html">

    现在:<iframe  src="xxx.html"> //<head></head>部分加了:<base href="http://www.google.com/">后



  • 相关阅读:
    leetcode_138复制带随机指针的链表
    minSTL
    LLVM
    STL基础_迭代器
    mysql数据库表清空后id如何从1开始自增
    explain用法和结果分析
    MySQL多表查询与子查询
    数据结构与算法笔记
    MySQL数据库的SQL语言与视图
    mysql忘记密码解决方案
  • 原文地址:https://www.cnblogs.com/jpfss/p/9116152.html
Copyright © 2011-2022 走看看