JSP中的 < base href="<%=basePath%>">作用
来源:互联网 发布:redis 安装配置 linux 编辑:程序博客网 时间:2024/06/07 05:36
小记 JSP中的 < base href=”<%=basePath%>”>作用:
<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%>
获取当前项目的路径,如:http://localhost:8080/项目名称。
<html> <head> <base href="<%=basePath%>"> </head> <body> </body></html>
这是设置当前界面的基础路径,默认表示表示该页面的请求是根路径下的。basePath上面中的变量,简单的静态网页的话你设置比如:<base href="http://localhost:8080//MYTest">
,那你下面的href属性就会以你上面设的为基准,如: <a href="http://localhost:8080//MYTest/xxx.htm"></a>
可以写成:<a href="xxx.htm"></a>
0 0
- 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%>">的作用
- Memcached 在windows下的java使用
- Python使用模板
- Android错误之Location of the Android SDK has not been setup in the preferences
- 此请求已被阻止,因为当用在 GET 请求中时,会将敏感信息透漏给第三方网站。若要允许 GET 请求,请将 JsonRequestBehavior 设置为 AllowGet。
- :before和::before的区别
- JSP中的 < base href="<%=basePath%>">作用
- Qt部件2----列表框,组合框
- nginx配置负载均衡
- java简单的动态代理示例
- 【Scala】Scala中的Nothing,Null,None,Nil
- 【C语言】求旋转数组的最小数字,输入一个递增排序的数组的一个旋转,输出其最小元素
- FFmpeg + Opencv 解码和显示
- hibernate缓存
- 排序之冒泡排序、插入排序及希尔排序