String path = request.getContextPath(); JSP中的相对Path的设置
来源:互联网 发布:linux eth0没有ip地址 编辑:程序博客网 时间:2024/05/16 08:43
String path = request.getContextPath(); JSP中的相对Path的设置
在JSP中我们总会出现一个路径问题比如:
jstest001是项目名
1、绝对路径
<script type="text/javascript" src="/jstest001/ext/ext-base.js"></script>和
2、相对路径
<script type="text/javascript" src="/ext/ext-base.js"></script>
在我们实际应用中,我们经常在jsp中使用到路径,可以有一些是从项目开始的绝对路径有一些是相对路径。而经常源码照抄过来不能运行。
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath%>">
其实是上面这三句话搞的鬼,很简单的一句话。如果没有这三句话的话就可以直接写到绝对路径,但是有的话就要写相对路径
阅读全文
0 0
- String path = request.getContextPath(); JSP中的相对Path的设置
- String path = request.getContextPath();JSP中的相对Path的设置
- String path = request.getContextPath(); JSP中的相对Path的设置
- JSP创建时的<% String path = request.getContextPath();%>
- String path = request.getContextPath
- String path = request.getContextPath(....拼装当前网页的相对路径
- String path = request.getContextPath(拼装当前网页的相对路径 )
- String path = request.getContextPath(....拼装当前网页的相对路径
- String path = request.getContextPath(....拼装当前网页的相对路径
- String path = request.getContextPath(....拼装当前网页的相对路径
- JSP中语句<% String path = request.getContextPath(); String basePath...的含义
- jsp文件中<% String path = request.getContextPath(); %>语句的作用
- String path = request.getContextPath路径问题
- String Path = request.getContextPath()报错
- String path = request.getContextPath();获取应用的上下文路径。
- String path = request.getContextPath();这段什么用
- 转发重定向用到的绝对路径 String path = request.getContextPath
- <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getSe
- 【Scikit-Learn 中文文档】决策树
- 前端网页、php与mysql数据库字符编码(解决中文等乱码问题)
- 盘点 2017 全球八大数据泄露案件,刷新你的认知
- Excel以文本存储的数字转成数字
- 【Scikit-Learn 中文文档】集成方法
- String path = request.getContextPath(); JSP中的相对Path的设置
- IMS/SIP
- shell中的各种括号的使用方法
- Hive metastore三种配置方式
- 【代码笔记】iOS-请求去掉url中的空格
- Go 并发编程之并发基础
- 雪花算法
- php开发公众号,查询用户分组,怎么知道用户属于哪个分组
- 深入浅出解读卷积神经网络