刚开始不知道是怎么回事,在网上也查找了一些资料,看了还是晕。
看了另一个大侠的,终于有了点眉目。
那位大侠在博客中这样写道“然后在网上找,更让我郁闷的事,TMD!网上“抄袭”的真多啊!而且扯了一大堆!关键的真没几个!让很郁闷!我心想:大哥们啊!你们贴在博客上的内容真的看懂了吗?我是看不懂!至少是说得我是很蒙!本来一句话可以搞定的事,偏偏啰嗦一大堆!而且贴的人还是很多!”
${pageContext.request.contextPath}等价于<%=request.getContextPath()%> 或者可以说是<%=request.getContextPath()%>的EL版 意思就是取出部署的应用程序名或者是当前的项目名称
比如我的项目名称是ajax01 在浏览器中输入为http://localhost:8080/ajax01/login.jsp ${pageContext.request.contextPath}或<%=request.getContextPath()%>取出来的就是/ajax01,而"/"代表的含义就是http://localhost:8080
所以我们项目中应该这样写${pageContext.request.contextPath}/login.jsp
分享到:
相关推荐
${pageContext.request.contextPath}是JSP取得绝对路径的方法 例如:浏览器地址栏为”http://localhost:8080/test/index.jsp “ 那么:取出来的就是”http://localhost:8080/test”,简写为”/test” /test 等价于 ...
在JSP里取${pageContext.request.contextPath},方式一是可以正常取到,但方式二却取到的是 字符“${pageContext.request.contextPath}” 方式一: [removed] var t = "${pageContext.request.contextPath}"; ...
${pageContext.request.contextPath}/checkcode.jsp"/> 另外在web.xml中配置验证码类的加载: <servlet-name>CheckCodeImage <servlet-class>com.netshop.common.util.CheckCodeImage</servlet-class> ...
<li><a href="${pageContext.request.contextPath}/student!list">学生信息管理</a></li> <li><a href="${pageContext.request.contextPath}/exam!list">学生作业情况查询</a></li> <li><a href="${pageContext....
自己在实际开发中,发现并解决问题的总结。
人脸识别,用于进行人脸检测.二、javaEE框架学习笔记 2、的涵义: ...其中:“${pageContext.request.contextPath}”就是获取request的绝对路径,它的作用相当于“<%=pageContext.request.contextPath%>” 3、
${pageContext.request.contextPath}/my/login" method="post"> ${message } 邮箱: 密码: 登录"> ${pageContext.request.contextPath}/my/regist">注册 ${pageContext.request....
form id=”form0″ action=”${pageContext.request.contextPath}/news/baikeAdd.form” enctype=”multipart/form-data” method=”POST” target=”hidden_frame”> … … </form> <iframe name=’...
href="${pageContext.request.contextPath}/ga/changeTaskAssigment.action?taskInstanceId=<s:property value="id"/>" >我来处理)</s:if> 受评对象准备评级资料"}'> ${pageContext.request.contextPath}/ga/...
link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/extjs/pulgins/datetime/datetime.css" /> [removed][removed] [removed][removed] [removed][removed] [removed]...
${pageContext.request.contextPath} 服务的web application 的名称 ${pageContext.request.method} 取得HTTP 的方法(GET、POST) ${pageContext.request.protocol} 取得使用的协议(HTTP/1.1、HTTP/1.0) ${...
link rel=”stylesheet” href=”${pageContext.request.contextPath}/common/kingeditor/themes/default/default.css”/> <link rel=”stylesheet” href=”${pageContext.request.contextPath}/common/...
codebase="${pageContext.request.contextPath }/common/plugins/calc/swflash.cab#version=6,0,0,0" id="BAPPFlash116526140886070277838"> value="${pageContext.request.contextPath }/common/plugins/calc...
link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/resources/css/login/login.css?version=20200311" /> </head> <body> <li><img src = "${pageContext....
url:"${pageContext.request.contextPath}/module/updateModuleOrder.html", dateType:"json", data:"moduleId="+id+"&num="+demo1.value, type:"post", success:function(result,textStatus){ ...
一、在jsp页面中定义<select>标签,如下: 科室: <select class="dept-name-show" style="width: 70%;...var url = "${pageContext.request.contextPath}/getDepts.do";//请求路径 $(".dept-name-show").cli
,url:'${pageContext.request.contextPath}/findcustomers' ,cols: [[ {align:'center', title: '编号', sort: true,type:'numbers',width:100} ]] ,page: true }); 我们就会获得一列有序的数列(ps:这里的...
url: "${pageContext.request.contextPath}/txtAddAcc", dataType: "json", data: {"id": 1, "userName": "张三", "money": 123}, contentType: "application/json", success: function(data) { alert(data....
//...省略向用户注册页面跳转方法 @RequestMapping("/registerUser") public String registerUser(User user) { String username = user.getUsername();... } <body> ${pageContext.request.contextPath }/reg