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/">后



  • 相关阅读:
    C# 线程间互相通信
    COM组件的使用方法
    C++基于ATL工程编写ActiveX控件步骤
    VC++编写ActiveX控件
    C#协作试取消线程
    Asp.net的内置对象!!!
    C#的三大特性
    类的静态方法。。。。。
    页面的生命周期
    .net面试题 2016
  • 原文地址:https://www.cnblogs.com/jpfss/p/9116152.html
Copyright © 2011-2022 走看看