var pathArray = window.location.pathname.split('/');
  var secondLevelLocation = pathArray[1];
  var loginUrl = window.location.protocol + "//"  + window.location.host + "/"+ secondLevelLocation;

在html中用js代替${pagecontext.request.getcontextpath}这样就不用使用jsp了的更多相关文章

  1. 上下文路径request.getContextPath();与${pageContext.request.contextPath}

    (1) request.getContextPath();与${pageContext.request.contextPath}都是获取上下文路径: 1. request.getContextPath ...

  2. js(JavaScript)使用${pageContext.request.contextPath}报错

    前几天写程序在js文件中用到了${pageContext.request.contextPath}然后一直报错,没有办法post到服务器,原来js把这个当成字符串了,一直以为他是jquery的函数! ...

  3. jsp获取绝对路径----${pageContext.request.contextPath}

    JSP取得绝对路径 在JavaWeb开发中,常使用绝对路径的方式来引入JavaScript和CSS文件,这样可以避免因为目录变动导致引入文件找不到的情况,常用的做法如下: 一.使用${pageCont ...

  4. ${pageContext.request.contextPath} JSP取得绝对路径

    一.问题     JSP中究竟采用绝对路径还是采用相对路径随着所采用技术的越来越复杂,这个问题也变得越来越难以解决. 1)采用相对路径遇到的问题      相对路径固然比较灵活,但如果想复制页面内的代 ...

  5. request.getContextPath获取绝对路径

    request.getContextPath获取绝对路径 博客分类: 经验+注意 其他 request.getContextPath 项目需求:所有jsp页必须通过Action转发,不能直接在地址栏链 ...

  6. 关于${pageContext.request.contextPath}的理解 (转载)

    ${pageContext.request.contextPath}是JSP取得绝对路径的方法,等价于<%=request.getContextPath()%> . 也就是取出部署的应用程 ...

  7. ${pageContext.request.contextPath}是JSP取得绝对路径(转载)

    ${pageContext.request.contextPath}是JSP取得绝对路径的方法,等价于<%=request.getContextPath()%> . 也就是取出部署的应用程 ...

  8. ${pageContext.request.contextPath}的解释以及和request.contextPath的区别

    JSP中究竟采用绝对路径还是采用相对路径随着所采用技术的越来越复杂,这个问题也变得越来越难以解决. 1)采用相对路径遇到的问题 l 相对路径固然比较灵活,但如果想复制页面内的代码却变得比较困难,因为不 ...

  9. 关于${pageContext.request.contextPath}的理解(转载)

    ${pageContext.request.contextPath}是JSP取得绝对路径的方法,等价于<%=request.getContextPath()%> . 也就是取出部署的应用程 ...

随机推荐

  1. url和资源的再理解

    元数据管理系统中, 确实是所有的静态资源都放在WebContent 不在dgs这个主项目中,通过url访问了 下面的这个项目在dgs中

  2. <------------------字符流--------------------->

    FileWriter 字符输出流: 方法: 写入:write 刷新:flush public static void main(String[] args) throws IOException { ...

  3. C++中的类模板

    一.学习笔记 1.类模板的格式(1)声明 template<typename T> /* 使用T表示某种类型,比如: */ class AAA { private: T obj; publ ...

  4. uname command

    The command uname helps us in development special in scripts, see help of the uname uname --help Usa ...

  5. python查看及修改当前的工作路径

    在pycharm中使用jupyter的时候,有时候需要查看当前的工作路径,然后需要修改当前的路径. 获取当前工作目录 os.getcwd() #用以获取当前的工作目录 改变当前工作目录 os.chdi ...

  6. wpf学习

    http://www.jikexueyuan.com/course/1231_3.html?ss=1 WPF入门教程系列二——Application介绍 http://www.cnblogs.com/ ...

  7. 自建mail服务器之二:hmailserver

    具体参考: http://blog.xuite.net/sendohshih/blog/41958216-3%E5%88%86%E9%90%98%E8%BC%95%E9%AC%86%E6%93%81% ...

  8. 突破本地离线存储的JS库 localforage

    localforage 简介 项目地址 https://github.com/localForage/localForage API中文地址 https://localforage.docschina ...

  9. TypeScript 之 tsconfig.json

    https://m.runoob.com/manual/gitbook/TypeScript/_book/doc/handbook/tsconfig.json.html 如果一个目录下存在一个tsco ...

  10. [转]Ubuntu python-config

    转自:http://manpages.ubuntu.com/manpages/precise/man1/python-config.1.html recise (1) python-config.1. ...