JSP中<base href="<%=basePath%>">作用
来源:互联网 发布:50元洗面奶推荐 知乎 编辑:程序博客网 时间:2024/04/28 15:31
JSP中<base href="<%=basePath%>">作用
JSP
通常在JSP页面开通有如下代码:
- <%
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
- %>
这段代码的意思是获取当前项目的路径,如:http://localhost:8080/项目名称。
在<head></head>中通常有如下代码:
- <base href="<%=basePath%>">
这是设置基础路径的,basePath为变量,简单的静态网页的话你设置比如:<base href="http://www.baidu.com">,那你下面的href属性就会以你上面设的为基准,例如:原网址<a href="http://www.baidu.com/xxx.htm"> </a> 那么你现在就只需要写<a href="xxx.htm"></a>就可以了
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">的作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">作用
- JSP中<base href="<%=basePath%>">的作用
- JSP中<base href="<%=basePath%>">作用
- Android 4.0 Camera架构分析之Camera初始化
- MySQL中Update、select联用操作单表、多表,及视图与临时表的区别
- 成都传智播客课程的优势
- WISE安装程序增加注册控制
- jQuery 取值、赋值的基本方法
- JSP中<base href="<%=basePath%>">作用
- Parsing C++ in Python with Clang
- 转win7下配置sql2005允许远程访问
- [Algorithm] 快排与冒泡
- AOP技术基础
- IOS cocos2d学习笔记-<六>CCParticalSystem粒子效果
- 项目名重复增加问题的解决
- 决对有用 asp.net 自定义验证码控件
- CRichEditCtrl自动响应和检测URL